3.12. Managing floating IP addresses

3.12.1. vinfra service compute floatingip create

Create a floating IP address:

usage: vinfra service compute floatingip create [--floating-ip-address <floating-ip-address>]
                                                [--port-id <port-id>]
                                                [--fixed-ip-address <fixed-ip-address>]
                                                [--description description] --network <network>
--floating-ip-address <floating-ip-address>
Floating IP address
--port-id <port-id>
ID of the port to be associated with the floating IP address. To learn the port ID of the selected virtual machine, use the command vinfra service compute server iface list.
--fixed-ip-address <fixed-ip-address>
Port IP address (required only if the port has multiple IP addresses)
--description description
Description of the floating IP address
--network <network>
ID or name of the network from which to allocate the floating IP

Example:

# vinfra service compute floatingip create 720e45bc-4225-49de-9346-26513d8d1262 \
--port-id 418c8c9e-aaa5-42f2-8da7-24bfead6f28b --fixed-ip-address 192.168.128.5
+---------------------+--------------------------------------+
| Field               | Value                                |
+---------------------+--------------------------------------+
| attached_to         | a172cb6a-1c7b-4157-9e86-035f3077646f |
| description         |                                      |
| fixed_ip_address    | 192.168.128.5                        |
| floating_ip_address | 10.94.129.72                         |
| floating_network_id | 720e45bc-4225-49de-9346-26513d8d1262 |
| id                  | a709f884-c43f-4a9a-a243-a340d7682ef8 |
| port_id             | 418c8c9e-aaa5-42f2-8da7-24bfead6f28b |
| project_id          | 894696133031439f8aaa7e4868dcbd4d     |
| router_id           | f7f86029-a553-4d61-b7ec-6f581d9c5f5f |
| status              | DOWN                                 |
+---------------------+--------------------------------------+

This command creates a floating IP address from the physical network with the ID 720e45bc-4225-49de-9346-26513d8d1262 and assigns it to a virtual machine on port with the ID 418c8c9e-aaa5-42f2-8da7-24bfead6f28b and the virtual IP address 192.168.128.5.

3.12.2. vinfra service compute floatingip list

List floating IP addresses:

usage: vinfra service compute floatingip list [--long] [--limit <num>]
                                              [--marker <floating-ip>]
                                              [--ip-address <ip-address>]
                                              [--id <id>]
                                              [--network <network>]
--long
Enable access and listing of all fields of objects.
--limit <num>
The maximum number of floating IPs to list. To list all floating IPs, set the option to -1.
--marker <floating-ip>
List floating IPs after the marker.
--ip-address <ip-address>
List floating IPs with the specified IP address or use a filter. Supported filter operator: contains. The filter format is <operator>:<value1>[,<value2>,...].
--id <id>
Show a floating IP with the specified ID or list floating IPs using a filter. Supported filter operator: in. The filter format is <operator>:<value1>[,<value2>,...].
--network <network>
List floating IPs that have the specified network name or ID.

Example:

# vinfra service compute floatingip list -c id -c fixed_ip_address -c port_id \
-c floating_ip_address -c floating_network_id
+----------------+------------------+----------------+---------------------+---------------------+
| id             | fixed_ip_address | port_id        | floating_ip_address | floating_network_id |
+----------------+------------------+----------------+---------------------+---------------------+
| a709f884-<...> | 192.168.128.5    | 418c8c9e-<...> | 10.94.129.72        | 720e45bc-<...>      |
+----------------+------------------+----------------+---------------------+---------------------+

This command lists floating IP addresses used in the compute cluster. (The output is abridged to fit on page.)

3.12.3. vinfra service compute floatingip show

Display information about a floating IP address:

usage: vinfra service compute floatingip show <floatingip>
<floatingip>
ID of the floating IP address

Example:

# vinfra service compute floatingip show a709f884-c43f-4a9a-a243-a340d7682ef8
+---------------------+--------------------------------------+
| Field               | Value                                |
+---------------------+--------------------------------------+
| attached_to         | a172cb6a-1c7b-4157-9e86-035f3077646f |
| description         |                                      |
| fixed_ip_address    | 192.168.128.5                        |
| floating_ip_address | 10.94.129.72                         |
| floating_network_id | 720e45bc-4225-49de-9346-26513d8d1262 |
| id                  | a709f884-c43f-4a9a-a243-a340d7682ef8 |
| port_id             | 418c8c9e-aaa5-42f2-8da7-24bfead6f28b |
| project_id          | 894696133031439f8aaa7e4868dcbd4d     |
| router_id           | f7f86029-a553-4d61-b7ec-6f581d9c5f5f |
| status              | ACTIVE                               |
+---------------------+--------------------------------------+

This command shows the details of the floating IP address with the ID a709f884-c43f-4a9a-a243-a340d7682ef8.

3.12.4. vinfra service compute floatingip set

Modify parameters of a floating IP address:

usage: vinfra service compute floatingip set [--port-id <port-id>]
                                             [--fixed-ip-address <fixed-ip-address>]
                                             [--description <description>] <floatingip>
--port-id <port-id>
ID of the port to be associated with the floating IP address
--fixed-ip-address <fixed-ip-address>
Port IP address (required only if the port has multiple IP addresses)
--description <description>
Description of the floating IP address
<floatingip>
ID of the floating IP address

Example:

# vinfra service compute floatingip set a709f884-c43f-4a9a-a243-a340d7682ef8 \
--description "Floating IP for myvm"
+---------------------+--------------------------------------+
| Field               | Value                                |
+---------------------+--------------------------------------+
| attached_to         | a172cb6a-1c7b-4157-9e86-035f3077646f |
| description         | Floating IP for myvm                 |
| fixed_ip_address    | 192.168.128.5                        |
| floating_ip_address | 10.94.129.72                         |
| floating_network_id | 720e45bc-4225-49de-9346-26513d8d1262 |
| id                  | a709f884-c43f-4a9a-a243-a340d7682ef8 |
| port_id             | 418c8c9e-aaa5-42f2-8da7-24bfead6f28b |
| project_id          | 894696133031439f8aaa7e4868dcbd4d     |
| router_id           | f7f86029-a553-4d61-b7ec-6f581d9c5f5f |
| status              | ACTIVE                               |
+---------------------+--------------------------------------+

This command adds a description for the floating IP address with the ID a709f884-c43f-4a9a-a243-a340d7682ef8.

3.12.5. vinfra service compute floatingip delete

Delete a floating IP address:

usage: vinfra service compute floatingip delete <floatingip>
<floatingip>
ID of the floating IP address

Example:

# vinfra service compute floatingip delete a709f884-c43f-4a9a-a243-a340d7682ef8
Operation successful

This command deletes the floating IP address with the ID a709f884-c43f-4a9a-a243-a340d7682ef8.