From 58206797190b3087bc9bdc2663fc278afe2f93c9 Mon Sep 17 00:00:00 2001 From: chenxing Date: Fri, 2 Dec 2016 05:14:52 +0000 Subject: [PATCH] [ops-guide] Replace "nova boot" with "openstack server create" Change-Id: Ic335d3e934d3d31e9cbfa37aafab7626037df08d Implements: blueprint use-openstack-command --- .../source/ops-customize-compute.rst | 2 +- .../source/ops-maintenance-compute.rst | 71 +++++++-------- .../source/ops-user-facing-operations.rst | 87 +++++++++++-------- 3 files changed, 86 insertions(+), 74 deletions(-) diff --git a/doc/ops-guide/source/ops-customize-compute.rst b/doc/ops-guide/source/ops-customize-compute.rst index 055a5180d3..b596ae087a 100644 --- a/doc/ops-guide/source/ops-customize-compute.rst +++ b/doc/ops-guide/source/ops-customize-compute.rst @@ -277,7 +277,7 @@ When you join the screen session that ``stack.sh`` starts with .. code-block:: console - $ nova boot --flavor 1 --image $IMAGE_ID scheduler-test + $ openstack server create --flavor 1 --image $IMAGE_ID scheduler-test #. Switch back to the ``n-sch`` screen. Among the log statements, you'll see the line: diff --git a/doc/ops-guide/source/ops-maintenance-compute.rst b/doc/ops-guide/source/ops-maintenance-compute.rst index 0225742df7..f672fa0aae 100644 --- a/doc/ops-guide/source/ops-maintenance-compute.rst +++ b/doc/ops-guide/source/ops-maintenance-compute.rst @@ -370,46 +370,47 @@ using neutron ports which contain the IPv4 & IPv6 address. .. code-block:: console - $ nova boot --flavor m1.medium --image ubuntu.qcow2 --key-name team_key \ - --nic port-id=PORT_ID "example-fqdn-01.sys.example.com" + $ openstack server create --flavor m1.medium --image ubuntu.qcow2 \ + --key-name team_key --nic port-id=PORT_ID \ + "example-fqdn-01.sys.example.com" #. Verify the instance has the correct IP address: .. code-block:: console - +-------------------------------------+-----------------------------------------------------------+ - | Property | Value | - +-------------------------------------+-----------------------------------------------------------+ - | OS-DCF:diskConfig | MANUAL | - | OS-EXT-AZ:availability_zone | nova | - | OS-EXT-SRV-ATTR:host | os_compute-1 | - | OS-EXT-SRV-ATTR:hypervisor_hostname | os_compute.ece.example.com | - | OS-EXT-SRV-ATTR:instance_name | instance-00012b82 | - | OS-EXT-STS:power_state | 1 | - | OS-EXT-STS:task_state | - | - | OS-EXT-STS:vm_state | active | - | OS-SRV-USG:launched_at | 2016-07-26T21:27:04.000000 | - | OS-SRV-USG:terminated_at | - | - | Public_AGILE network | 2001:558:fc0b:100:f816:3eff:fefb:65fc, 96.118.182.107 | - | accessIPv4 | | - | accessIPv6 | | - | config_drive | | - | created | 2016-07-26T21:26:42Z | - | flavor | m1.medium (103) | - | hostId | b0a4684922bce321770daf033032d9115fe3e13190191bf01dbc357a | - | id | 9ff9a672-d496-470a-84a7-284799a777fd | - | image | Example Cloud Ubuntu 14.04 x86_64 v2.5 (fb49d7e1-273b-... | - | key_name | team_key | - | metadata | {} | - | name | example-fqdn-01.sys.example.com | - | os-extended-volumes:volumes_attached| [] | - | progress | 0 | - | security_groups | default | - | status | ACTIVE | - | tenant_id | 52f0574689f14c8a99e7ca22c4eb5720 | - | updated | 2016-07-26T21:27:04Z | - | user_id | e37b87cb8d784cc3a85e475f67b32ab5 | - +-------------------------------------+-----------------------------------------------------------+ + +--------------------------------------+----------------------------------------------------------+ + | Field | Value | + +--------------------------------------+----------------------------------------------------------+ + | OS-DCF:diskConfig | MANUAL | + | OS-EXT-AZ:availability_zone | nova | + | OS-EXT-SRV-ATTR:host | os_compute-1 | + | OS-EXT-SRV-ATTR:hypervisor_hostname | os_compute.ece.example.com | + | OS-EXT-SRV-ATTR:instance_name | instance-00012b82 | + | OS-EXT-STS:power_state | Running | + | OS-EXT-STS:task_state | None | + | OS-EXT-STS:vm_state | active | + | OS-SRV-USG:launched_at | 2016-11-30T08:55:27.000000 | + | OS-SRV-USG:terminated_at | None | + | accessIPv4 | | + | accessIPv6 | | + | addresses | public=172.24.4.236 | + | config_drive | | + | created | 2016-11-30T08:55:14Z | + | flavor | m1.medium (103) | + | hostId | aca973d5b7981faaf8c713a0130713bbc1e64151be65c8dfb53039f7 | + | id | f91bd761-6407-46a6-b5fd-11a8a46e4983 | + | image | Example Cloud Ubuntu 14.04 x86_64 v2.5 (fb49d7e1-273b-...| + | key_name | team_key | + | name | example-fqdn-01.sys.example.com | + | os-extended-volumes:volumes_attached | [] | + | progress | 0 | + | project_id | 2daf82a578e9437cab396c888ff0ca57 | + | properties | | + | security_groups | [{u'name': u'default'}] | + | status | ACTIVE | + | updated | 2016-11-30T08:55:27Z | + | user_id | 8cbea24666ae49bbb8c1641f9b12d2d2 | + +--------------------------------------+----------------------------------------------------------+ #. Check the port connection using the netcat utility: diff --git a/doc/ops-guide/source/ops-user-facing-operations.rst b/doc/ops-guide/source/ops-user-facing-operations.rst index f45526f2c2..d873906131 100644 --- a/doc/ops-guide/source/ops-user-facing-operations.rst +++ b/doc/ops-guide/source/ops-user-facing-operations.rst @@ -1593,7 +1593,7 @@ On the command line, do this: .. code-block:: console - $ nova boot --flavor --image + $ openstack server create --flavor FLAVOR --image IMAGE NAME There are a number of optional items that can be specified. You should read the rest of this section before trying to start an instance, but @@ -1717,51 +1717,60 @@ your command line. For example: .. code-block:: console - $ nova boot --image ubuntu-cloudimage --flavor 2 --key-name mykey myimage + $ openstack server create --image ubuntu-cloudimage --flavor 2 \ + --key-name mykey myimage When booting a server, you can also add arbitrary metadata so that you can more easily identify it among other running instances. Use the -:option:`--meta` option with a key-value pair, where you can make up the -string for both the key and the value. For example, you could add a +:option:`--property` option with a key-value pair, where you can make up +the string for both the key and the value. For example, you could add a description and also the creator of the server: .. code-block:: console - $ nova boot --image=test-image --flavor=1 \ - --meta description='Small test image' smallimage + $ openstack server create --image=test-image --flavor=1 \ + --property description='Small test image' smallimage When viewing the server information, you can see the metadata included on the metadata line: .. code-block:: console - $ nova show smallimage - +------------------------+-----------------------------------------+ - | Property | Value | - +------------------------+-----------------------------------------+ - | OS-DCF:diskConfig | MANUAL | - | OS-EXT-STS:power_state | 1 | - | OS-EXT-STS:task_state | None | - | OS-EXT-STS:vm_state | active | - | accessIPv4 | | - | accessIPv6 | | - | config_drive | | - | created | 2012-05-16T20:48:23Z | - | flavor | m1.small | - | hostId | de0...487 | - | id | 8ec...f915 | - | image | natty-image | - | key_name | | - | metadata | {u'description': u'Small test image'} | - | name | smallimage | - | private network | 172.16.101.11 | - | progress | 0 | - | public network | 10.4.113.11 | - | status | ACTIVE | - | tenant_id | e83...482 | - | updated | 2012-05-16T20:48:35Z | - | user_id | de3...0a9 | - +------------------------+-----------------------------------------+ + $ openstack server show smallimage + + +--------------------------------------+----------------------------------------------------------+ + | Field | Value | + +--------------------------------------+----------------------------------------------------------+ + | OS-DCF:diskConfig | MANUAL | + | OS-EXT-AZ:availability_zone | nova | + | OS-EXT-SRV-ATTR:host | rdo-newton.novalocal | + | OS-EXT-SRV-ATTR:hypervisor_hostname | rdo-newton.novalocal | + | OS-EXT-SRV-ATTR:instance_name | instance-00000002 | + | OS-EXT-STS:power_state | Running | + | OS-EXT-STS:task_state | None | + | OS-EXT-STS:vm_state | active | + | OS-SRV-USG:launched_at | 2016-12-07T11:20:08.000000 | + | OS-SRV-USG:terminated_at | None | + | accessIPv4 | | + | accessIPv6 | | + | addresses | public=172.24.4.227 | + | config_drive | | + | created | 2016-12-07T11:17:44Z | + | flavor | m1.tiny (1) | + | hostId | aca973d5b7981faaf8c713a0130713bbc1e64151be65c8dfb53039f7 | + | id | 4f7c6b2c-f27e-4ccd-a606-6bfc9d7c0d91 | + | image | cirros (01bcb649-45d7-4e3d-8a58-1fcc87816907) | + | key_name | None | + | name | smallimage | + | os-extended-volumes:volumes_attached | [] | + | progress | 0 | + | project_id | 2daf82a578e9437cab396c888ff0ca57 | + | properties | description='Small test image' | + | security_groups | [{u'name': u'default'}] | + | status | ACTIVE | + | updated | 2016-12-07T11:20:08Z | + | user_id | 8cbea24666ae49bbb8c1641f9b12d2d2 | + +--------------------------------------+----------------------------------------------------------+ Instance user data ------------------ @@ -1782,7 +1791,8 @@ For example .. code-block:: console - $ nova boot --image ubuntu-cloudimage --flavor 1 --user-data mydata.file mydatainstance + $ openstack server create --image ubuntu-cloudimage --flavor 1 \ + --user-data mydata.file mydatainstance To understand the difference between user data and metadata, realize that user data is created before an instance is started. User data is @@ -1803,8 +1813,9 @@ case, you can use the following command: .. code-block:: console - $ nova boot --image ubuntu-cloudimage --flavor 1 \ - --file /root/.ssh/authorized_keys=special_authorized_keysfile authkeyinstance + $ openstack server create --image ubuntu-cloudimage --flavor 1 \ + --file /root/.ssh/authorized_keys=special_authorized_keysfile \ + authkeyinstance Associating Security Groups ~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -1920,7 +1931,7 @@ the instance is terminated: .. code-block:: console - $ nova boot --image 4042220e-4f5e-4398-9054-39fbd75a5dd7 \ + $ openstack server create --image 4042220e-4f5e-4398-9054-39fbd75a5dd7 \ --flavor 2 --key-name mykey --block-device-mapping vdc=13:::0 \ boot-with-vol-test @@ -1932,7 +1943,7 @@ is now attached as ``/dev/vda``: .. code-block:: console - $ nova boot --flavor 2 --key-name mykey \ + $ openstck server create --flavor 2 --key-name mykey \ --block-device-mapping vda=13:::0 boot-from-vol-test Read more detailed instructions for launching an instance from a