openstack-manuals/doc/admin-guide/source/cli_nova_specify_host.rst
chen.xing 11dd0c145c [admin-guide] Fix the incorrect command
BTW, Use the OpenStack CLI instead of nova.

Change-Id: I2b5299c0fe315db5e92b5b604a50ade4efd05f03
Closes-Bug: #1595770
2016-06-30 11:25:19 +00:00

1.2 KiB

Select hosts where instances are launched

With the appropriate permissions, you can select which host instances are launched on and which roles can boot instances on this host.

  1. To select the host where instances are launched, use the --availability-zone ZONE:HOST parameter on the openstack server create command.

    For example:

    $ openstack server create --image IMAGE --flavor m1.tiny \
      --key-name KEY --availability-zone ZONE:HOST \
      --nic net-id=UUID SERVER
  2. To specify which roles can launch an instance on a specified host, enable the create:forced_host option in the policy.json file. By default, this option is enabled for only the admin role.

  3. To view the list of valid compute hosts, use the openstack hypervisor list command.

    $ openstack hypervisor list
    +----+---------------------+
    | ID | Hypervisor Hostname |
    +----+---------------------+
    |  1 | server2             |
    |  2 | server3             |
    |  3 | server4             |
    +----+---------------------+