G.5 Before a VM Instance has been Booted: Allowed Address Pairs
# neutron port-create –-name <Port Name> --fixed-ip subnet-id=$(neutron subnet-show –f value –F id <Subnet name>),ip_address=<Target IP address>
$(neutron net-show –f value –F id <Network name>) --allowed_address_pairs list=true type=dict ip_address=<VIP address to be added>
Where the bolded items have the following meaning:
- <Port Name>
This is effectively a string alias for the port that is useful when trying to locate the ID for the port but the –-name <Port Name> portion of the command is completely optional.
- <Subnet name>
The name of the subnet to which the port should be added.
- <Target IP address>
The unique IP address to be associated with the port.
- <Network Name>
The name of the network with which the port should be associated.
- <VIP address to be added>
This parameter value has the same meaning as described in the previous section.
# neutron port-create –name foo --fixed-ip subnet-id=$(neutron subnet-show –f value –F id ext-subnet),ip_address=10.133.97.133 $(neutron net-show –f value –F id ext-net) --allowed_address_pairs list=true type=dict ip_address=10.133.97.134/32
# nova boot --flavor m1.xlarge --image testVMimage --nic port-id=$(neutron port-show –f value –F id <Port Name>) testvm3
where the flavor, image, and VM instance name values need to be replaced by values
appropriate for your VM. If the port to be associated with the VM instance is not named,
then you need to obtain the port’s ID using the neutron port-list command and replace
the $(neutron port-show –f value –F id <Port Name>)
sequence in the
above command with the port’s ID value.