openstack-manuals/doc/common/section_nova_cli_floatingip.xml
Andreas Jaeger 34a567089b Fix markup
This fixes mainly screens, computeroutput/userinput and also
marks some filenames. A lot of prompts have been added.

Change-Id: I864dc5b051bb297b61c9b2ed5464f9a35306bd68
Partial-Bug: #1217503
2013-09-17 16:08:17 +02:00

98 lines
5.9 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<section
xmlns="http://docbook.org/ns/docbook"
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:xlink="http://www.w3.org/1999/xlink"
version="5.0"
xml:id="floating_ip_addresses">
<title>Manage Floating IP Addresses</title>
<para>A floating IP address is an IP address (typically public) that
can be dynamically assigned to an instance. Pools of floating IP
addresses are created outside of python-novaclient with the
<command>nova-manage floating *</command> commands. Refer to
"<uri
xlink:href="http://docs.openstack.org/trunk/openstack-compute/admin/content/associating-public-ip.html"
>Configuring Public (Floating) IP Addresses</uri>" in the
<emphasis>OpenStack Compute Administration Manual</emphasis> for
more information.</para>
<para>Before you begin, use <command>nova
floating-ip-pool-list</command> to determine what floating IP pools
are available.
<screen><prompt>$</prompt> <userinput>nova floating-ip-pool-list</userinput>
<computeroutput> +------+
| name |
+------+
| nova |
+------+</computeroutput></screen>
In this example,
the only available pool is <literal>nova</literal>.</para>
<section xml:id="floating_ip_reserve_add"><title>Reserve and associate floating IP addresses</title>
<para>You can reserve floating IP addresses with the <command>nova
floating-ip-create</command> command. This command reserves the
addresses for the tenant, but does not immediately associate that
address with an instance.
<screen><prompt>$</prompt> <userinput>nova floating-ip-create nova</userinput>
<computeroutput>+--------------+-------------+----------+------+
| Ip | Instance Id | Fixed Ip | Pool |
+--------------+-------------+----------+------+
| 50.56.12.232 | None | None | nova |
+--------------+-------------+----------+------+ </computeroutput></screen>
</para>
<para>The floating IP address has been reserved, and can now be
associated with an instance with the <command>nova
add-floating-ip</command> command. For this example, we'll associate
this IP address with an image called <literal>smallimage</literal>.
<screen><prompt>$</prompt> <userinput>nova add-floating-ip smallimage 50.56.12.232</userinput></screen>
After the command is complete, you can confirm that the IP address
has been associated with the <command>nova
floating-ip-list</command> and <command>nova-list</command>
commands.
<screen><prompt>$</prompt> <userinput>nova floating-ip-list</userinput>
<computeroutput>+--------------+--------------------------------------+------------+------+
| Ip | Instance Id | Fixed Ip | Pool |
+--------------+--------------------------------------+------------+------+
| 50.56.12.232 | 542235df-8ba4-4d08-90c9-b79f5a77c04f | 10.4.113.9 | nova |
+--------------+--------------------------------------+------------+------+</computeroutput>
<prompt>$</prompt> <userinput>nova list</userinput>
<computeroutput>+--------------------------------------+------------+--------+-------------------------------------------------------+
| ID | Name | Status | Networks |
+--------------------------------------+------------+--------+-------------------------------------------------------+
| 4bb825ea-ea43-4771-a574-ca86ab429dcb | tinyimage2 | ACTIVE | public=10.4.113.6; private=172.16.101.6 |
| 542235df-8ba4-4d08-90c9-b79f5a77c04f | smallimage | ACTIVE | public=10.4.113.9, 50.56.12.232; private=172.16.101.9 |
+--------------------------------------+------------+--------+-------------------------------------------------------+
</computeroutput></screen>
The first table shows that the 50.56.12.232 is now associated with the
<literal>smallimage</literal> instance ID, and the second table shows
the IP address included under <literal>smallimage</literal>'s public
IP addresses.</para></section>
<section xml:id="floating_ip_address_remove"><title>Remove and de-allocate a floating IP address</title>
<para>To remove a floating IP address from an instance, use
the <command>nova remove-floating-ip</command>
command.<screen><prompt>$</prompt> <userinput>nova remove-floating-ip smallimage 50.56.12.232</userinput></screen>
After the command is complete, you can confirm that the IP address has
been associated with the <command>nova floating-ip-list</command> and
<command>nova-list</command> commands.
<screen><prompt>$</prompt> <userinput>nova floating-ip-list</userinput>
<computeroutput>+--------------+-------------+----------+------+
| Ip | Instance Id | Fixed Ip | Pool |
+--------------+-------------+----------+------+
| 50.56.12.232 | None | None | nova |
+--------------+-------------+----------+------+</computeroutput>
<prompt>$</prompt> <userinput>nova list</userinput>
<computeroutput>+--------------------------------------+------------+--------+-----------------------------------------+
| ID | Name | Status | Networks |
+--------------------------------------+------------+--------+-----------------------------------------+
| 4bb825ea-ea43-4771-a574-ca86ab429dcb | tinyimage2 | ACTIVE | public=10.4.113.6; private=172.16.101.6 |
| 542235df-8ba4-4d08-90c9-b79f5a77c04f | smallimage | ACTIVE | public=10.4.113.9; private=172.16.101.9 |
+--------------------------------------+------------+--------+-----------------------------------------+</computeroutput></screen>
You can now de-allocate the floating IP address, returning it to the
pool so that it can be used by another tenant.
<screen><prompt>$</prompt> <userinput>nova floating-ip-delete 50.56.12.232</userinput></screen>
In this example, 50.56.12.232 was the only IP address allocated to
this tenant. Running <command>nova floating-ip-list</command> after
the de-allocation is complete will return no results.</para>
</section>
</section>