openstack-manuals/doc/admin-guide/source/cli-nova-specify-host.rst
Andreas Jaeger 2d44b2b36d Prepare for Sphinx 1.5
The new sphinx version introduces some changes that break build:

* Warns if code cannot be parsed for highlighting. Fix the code so
  that it can be parsed, this includes uncommenting "..." lines.
  Note that not every config file is an ini-file.
  Also, the parser seems to have bugs and cannot parse all files.
  Fix mysql ini file and enable the parameter, see
http://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_file_per_table
* :option: works only with declared options, replace useage with
  simple ``.

This change only handles a few files, more to come later.

Change-Id: I7c7335e514581622dd562ee355f62d6ae1beaa18
2017-01-11 20:37:55 +01:00

2.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:NODE parameter on the openstack server create command.

    For example:

    $ openstack server create --image IMAGE --flavor m1.tiny \
      --key-name KEY --availability-zone ZONE:HOST:NODE \
      --nic net-id=UUID SERVER

    Note

    HOST is an optional parameter. In such cases, use the --availability-zone ZONE::NODE.

  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. If you see Forbidden (HTTP 403) in return, then you are not using admin credentials.

  3. To view the list of valid zones, use the openstack availability zone list command.

    $ openstack availability zone list
    +-----------+-------------+
    | Zone Name | Zone Status |
    +-----------+-------------+
    | zone1     | available   |
    | zone2     | available   |
    +-----------+-------------+
  4. To view the list of valid compute hosts, use the openstack host list command.

    $ openstack host list
    +----------------+-------------+----------+
    | Host Name      | Service     | Zone     |
    +----------------+-------------+----------+
    | compute01      | compute     | nova     |
    | compute02      | compute     | nova     |
    +----------------+-------------+----------+
  5. To view the list of valid compute nodes, use the openstack hypervisor list command.

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