vmware/vic-ui

VCH wizard does not create --container-network-gateway parameter in CIDR format

Closed this issue · 4 comments

VIC-UI version:
v1.4.1.1262

Platform details:
Windows Server 2012 R2

Browser details:
FireFox 60.2 ESR

Additional details:
Fresh install of VIC

Steps to reproduce:
Create a VCH in the vSphere Client using following parameters taken from the vic-machine command which was auto generated.

./vic-machine-linux create --name VCH_01 --compute-resource /SA-Datacenter/host/SA-Compute --image-store SA-Shared-01-Remote/VCH_01_IDS --base-image-size 8GB --volume-store SA-Shared-01-Remote/VCH_01_VDS:default --bridge-network pg-Bridge --bridge-network-range 172.16.0.0/12 --public-network pg-Public --public-network-ip 192.168.0.97/24 --public-network-gateway 192.168.0.10 --dns-server 172.20.10.10 --client-network pg-Clients --client-network-ip 10.2.10.97/24 --client-network-gateway 172.20.10.10/24:10.2.10.10 --management-network pg-SA-Management --management-network-ip 172.20.10.97/24 --management-network-gateway 172.20.10.10/24:172.20.10.10 --container-network pg-Containers:container-nw --container-network-ip-range pg-Containers:10.1.10.100-10.1.10.200 --container-network-gateway pg-Containers:10.1.10.10 --container-network-dns pg-Containers:10.1.10.10 --container-network-firewall pg-Containers:published --tls-cname VCH_01 --certificate-key-size 2048 --no-tlsverify --user Administrator@VSPHERE.LOCAL --thumbprint AE:22:9A:DC:83:01:A3:27:F6:31:16:44:99:F9:C3:60:66:19:56:25 --target sa-vcsa-01.vclass.local/SA-Datacenter --registry-ca ca.crt --ops-user administrator@vsphere.local

Actual behavior:
From above in bold, it can be seen the auto generated vic-machine command is missing the CIDR format for the --container-network-gateway parameter. It is "pg-Containers:10.1.10.10". Alas, the VCH wizard generated vic-machine command will fail if ran.

Expected behavior:
"--container-network-gateway pg-Containers:10.1.10.10" should be in a CIDR format such as "--container-network-gateway pg-Containers:10.1.10.10/24"

Issue exists in v1.4.3 also

zjs commented

It looks like this is closely related to both #606 and #568.

The documentation indicates that the format for the container network gateway field should be a CIDR, but the UI appears to instruct users to enter an IP address:

<input class="form-control" id="container-network-gateway" type="text" placeholder="IP address" formControlName="containerNetworkGateway">
<span class="tooltip-content" *ngIf="form.get('containerNetworks').controls[i].controls.containerNetworkGateway.hasError('required')">
Container network gateway cannot be empty
</span>
<span class="tooltip-content" *ngIf="form.get('containerNetworks').controls[i].controls.containerNetworkGateway.hasError('pattern')">
Gateway address is not valid
</span>

The UI appears to validate that an IP address (not CIDR) is entered:

containerNetworkGateway: [{ value: '', disabled: true }, [
Validators.required,
Validators.pattern(ipPattern)
]],

It seems like there are several parts to this fix:

  • Allow for the routing destination information to be supplied for container networks. Essentially, this means applying the change from #583 to container networks as well. (Resolves #606.)
  • Ensure that the routing destination information is included in the generated CLI command. (Resolves this issue.)
  • Beyond the automated testing necessary to resolve the above, audit the testing of the networking UI to ensure there are no gaps that might indicate similar issues. (May require a new issue.)

@zjs, does it mean we should modify gateway in ui to only allow CIDR format input?

fixed by :#619