[BUG] Assign IPv6 fails with an ip-address set
Hi,
I wanted to assign an IPv6 address of my choice within the subnet using oci-cli. For that I have used the following command:
oci network vnic assign-ipv6 --vnic-id $vnicId --ip-address "2603:<redacted>::2" --unassign-if-already-assigned
Which then returns:
ServiceError:
{
"code": "InvalidParameter",
"message": "Conflicting query parameters {vnicId and ipAddress} are specified {Both parameters cannot be specified}",
"opc-request-id": "<redacted>",
"status": 400
}
If I don't specify the --ip-address flag then it works fine and it creates a new IPv6 address assigned to the VM, however that one is random.
Using the webinterface I was able to add the same IPv6 I wanted. So I copied the exact same JSON body the browser sent into $HOME/test.json:
{"vnicId":"<redacted>","ipAddress":"2603:<redacted>::2","definedTags":{},"freeformTags":{}}
And then executed: oci network vnic assign-ipv6 --from-json file://$HOME/test.json
The result was the same error like above.
I am wondering why is this happening exactly when even the docs mentions that you can specify both together: https://docs.oracle.com/en-us/iaas/tools/oci-cli/2.25.2/oci_cli_docs/cmdref/network/vnic/assign-ipv6.html#cmdoption-ip-address
--ip-address [text]An IPv6 address of your choice. Must be an available IP address within the subnet's CIDR. If you don't specify a value, Oracle automatically assigns an IPv6 address from the subnet. The subnet is the one that contains the VNIC you specify in vnicId.
Am I doing something wrong?
I also get this issue. I don't think you're doing anything wrong. The way I read it, the ServiceError message text contradicts the documentation; it doesn't make sense for a required parameter to conflict with any other parameter, since then that other parameter is not possible to use.
Edit to add: This issue exists for me today with oci-cli v3.0.5.
This issue is fixed with the latest version of OCI CLI.