openstack-manuals/doc/install-guide/source/launch-instance-provider.rst
Pranav Salunke de38f2767f install: Updates syntax for training labs parser.
Training labs parser will allow us to automatically parse RST code
to BASH. This BASH code in turn will be invoked by install-guides for
validating the install guides. To provide the correct information to the
parser for generating BASH code, there are a few changes required to the
RST syntax.

Introduces the following changes to RST syntax:

  - `.. end`

    This tag provides information for the parser to stop extracting the
    given block which could be code, file injection or configuration
    file edit.

  - `.. endonly`

    This tag provides information for the parser with the correct
    distro-switch logic for identifying distro-specific code.

    For .. only:: tags, it is better to avoid nesting. If nesting
    is not avoidable then it is preferable to add the .. endonly
    tag to close the outer block immediately.

  - Extra new lines in code-blocks

    Some commands in the code-blocks provides the expected output of the
    given command. This is not a BASH command which we want to run but
    rather some visual niceness for the users. These new lines provides
    the parser information to identify the end of the command. This
    basic logic would be something similar to find '\r\n' which at least
    for python means new empty line.

  - `mysql>`

    Introducing this operator for mysql commands. This could potentially
    be changed to `pgsql>` or similar for other SQL type databases.
    This allows the parser to identify mysql commands and then run
    them in mysql instead of in 'sh' or 'bash'.

  - `.. path`

    Introducing this tag to provide the parser with the information with
    the path of the configuration file. Using the description text for
    the same is not reliable since the description text may not be
    consistent.

This commit should ideally introduce all the syntax changes required for
the parser to convert the code-blocks in here to BASH code. These
changes should have no impact on the HTML output of the RST code.

Change-Id: I47830b1bc61c8b1a0f3350932d15aa3ce88fa672
2016-09-28 10:58:06 +02:00

12 KiB

Launch an instance on the provider network

Determine instance options

To launch an instance, you must at least specify the flavor, image name, network, security group, key, and instance name.

  1. On the controller node, source the demo credentials to gain access to user-only CLI commands:

    $ . demo-openrc
  2. A flavor specifies a virtual resource allocation profile which includes processor, memory, and storage.

    List available flavors:

    $ openstack flavor list
    +----+-----------+-------+------+-----------+-------+-----------+
    | ID | Name      |   RAM | Disk | Ephemeral | VCPUs | Is Public |
    +----+-----------+-------+------+-----------+-------+-----------+
    | 1  | m1.tiny   |   512 |    1 |         0 |     1 | True      |
    | 2  | m1.small  |  2048 |   20 |         0 |     1 | True      |
    | 3  | m1.medium |  4096 |   40 |         0 |     2 | True      |
    | 4  | m1.large  |  8192 |   80 |         0 |     4 | True      |
    | 5  | m1.xlarge | 16384 |  160 |         0 |     8 | True      |
    +----+-----------+-------+------+-----------+-------+-----------+

    This instance uses the m1.tiny flavor. If you created the optional m1.nano flavor, use it instead of the m1.tiny flavor.

    Note

    You can also reference a flavor by ID.

  3. List available images:

    $ openstack image list
    +--------------------------------------+--------+--------+
    | ID                                   | Name   | Status |
    +--------------------------------------+--------+--------+
    | 390eb5f7-8d49-41ec-95b7-68c0d5d54b34 | cirros | active |
    +--------------------------------------+--------+--------+

    This instance uses the cirros image.

  4. List available networks:

    $ openstack network list
    +--------------------------------------+--------------+--------------------------------------+
    | ID                                   | Name         | Subnets                              |
    +--------------------------------------+--------------+--------------------------------------+
    | 4716ddfe-6e60-40e7-b2a8-42e57bf3c31c | selfservice  | 2112d5eb-f9d6-45fd-906e-7cabd38b7c7c |
    | b5b6993c-ddf9-40e7-91d0-86806a42edb8 | provider     | 310911f6-acf0-4a47-824e-3032916582ff |
    +--------------------------------------+--------------+--------------------------------------+

    This instance uses the provider provider network. However, you must reference this network using the ID instead of the name.

    Note

    If you chose option 2, the output should also contain the selfservice self-service network.

  5. List available security groups:

    $ openstack security group list
    +--------------------------------------+---------+------------------------+
    | ID                                   | Name    | Description            |
    +--------------------------------------+---------+------------------------+
    | dd2b614c-3dad-48ed-958b-b155a3b38515 | default | Default security group |
    +--------------------------------------+---------+------------------------+

    This instance uses the default security group.

Launch the instance

  1. Launch the instance:

    Replace PROVIDER_NET_ID with the ID of the provider provider network.

    Note

    If you chose option 1 and your environment contains only one network, you can omit the --nic option because OpenStack automatically chooses the only network available.

    $ openstack server create --flavor m1.tiny --image cirros \
      --nic net-id=PROVIDER_NET_ID --security-group default \
      --key-name mykey provider-instance
    
    +--------------------------------------+-----------------------------------------------+
    | Property                             | Value                                         |
    +--------------------------------------+-----------------------------------------------+
    | OS-DCF:diskConfig                    | MANUAL                                        |
    | OS-EXT-AZ:availability_zone          | nova                                          |
    | OS-EXT-STS:power_state               | 0                                             |
    | OS-EXT-STS:task_state                | scheduling                                    |
    | OS-EXT-STS:vm_state                  | building                                      |
    | OS-SRV-USG:launched_at               | -                                             |
    | OS-SRV-USG:terminated_at             | -                                             |
    | accessIPv4                           |                                               |
    | accessIPv6                           |                                               |
    | adminPass                            | hdF4LMQqC5PB                                  |
    | config_drive                         |                                               |
    | created                              | 2015-09-17T21:58:18Z                          |
    | flavor                               | m1.tiny (1)                                   |
    | hostId                               |                                               |
    | id                                   | 181c52ba-aebc-4c32-a97d-2e8e82e4eaaf          |
    | image                                | cirros (38047887-61a7-41ea-9b49-27987d5e8bb9) |
    | key_name                             | mykey                                         |
    | metadata                             | {}                                            |
    | name                                 | provider-instance                             |
    | os-extended-volumes:volumes_attached | []                                            |
    | progress                             | 0                                             |
    | security_groups                      | default                                       |
    | status                               | BUILD                                         |
    | tenant_id                            | f5b2ccaa75ac413591f12fcaa096aa5c              |
    | updated                              | 2015-09-17T21:58:18Z                          |
    | user_id                              | 684286a9079845359882afc3aa5011fb              |
    +--------------------------------------+-----------------------------------------------+
  2. Check the status of your instance:

    $ openstack server list
    
    +--------------------------------------+-------------------+--------+---------------------------------+
    | ID                                   | Name              | Status | Networks                        |
    +--------------------------------------+-------------------+--------+---------------------------------+
    | 181c52ba-aebc-4c32-a97d-2e8e82e4eaaf | provider-instance | ACTIVE | provider=203.0.113.103          |
    +--------------------------------------+-------------------+--------+---------------------------------+

    The status changes from BUILD to ACTIVE when the build process successfully completes.

Access the instance using the virtual console

  1. Obtain a Virtual Network Computing (VNC) session URL for your instance and access it from a web browser:

    $ openstack console url show provider-instance
    
    +-------+---------------------------------------------------------------------------------+
    | Field | Value                                                                           |
    +-------+---------------------------------------------------------------------------------+
    | type  | novnc                                                                           |
    | url   | http://controller:6080/vnc_auto.html?token=5eeccb47-525c-4918-ac2a-3ad1e9f1f493 |
    +-------+---------------------------------------------------------------------------------+

    Note

    If your web browser runs on a host that cannot resolve the controller host name, you can replace controller with the IP address of the management interface on your controller node.

    The CirrOS image includes conventional user name/password authentication and provides these credentials at the login prompt. After logging into CirrOS, we recommend that you verify network connectivity using ping.

  2. Verify access to the provider physical network gateway:

    $ ping -c 4 203.0.113.1
    
    PING 203.0.113.1 (203.0.113.1) 56(84) bytes of data.
    64 bytes from 203.0.113.1: icmp_req=1 ttl=64 time=0.357 ms
    64 bytes from 203.0.113.1: icmp_req=2 ttl=64 time=0.473 ms
    64 bytes from 203.0.113.1: icmp_req=3 ttl=64 time=0.504 ms
    64 bytes from 203.0.113.1: icmp_req=4 ttl=64 time=0.470 ms
    
    --- 203.0.113.1 ping statistics ---
    4 packets transmitted, 4 received, 0% packet loss, time 2998ms
    rtt min/avg/max/mdev = 0.357/0.451/0.504/0.055 ms
  3. Verify access to the internet:

    $ ping -c 4 openstack.org
    
    PING openstack.org (174.143.194.225) 56(84) bytes of data.
    64 bytes from 174.143.194.225: icmp_req=1 ttl=53 time=17.4 ms
    64 bytes from 174.143.194.225: icmp_req=2 ttl=53 time=17.5 ms
    64 bytes from 174.143.194.225: icmp_req=3 ttl=53 time=17.7 ms
    64 bytes from 174.143.194.225: icmp_req=4 ttl=53 time=17.5 ms
    
    --- openstack.org ping statistics ---
    4 packets transmitted, 4 received, 0% packet loss, time 3003ms
    rtt min/avg/max/mdev = 17.431/17.575/17.734/0.143 ms

Access the instance remotely

  1. Verify connectivity to the instance from the controller node or any host on the provider physical network:

    $ ping -c 4 203.0.113.103
    
    PING 203.0.113.103 (203.0.113.103) 56(84) bytes of data.
    64 bytes from 203.0.113.103: icmp_req=1 ttl=63 time=3.18 ms
    64 bytes from 203.0.113.103: icmp_req=2 ttl=63 time=0.981 ms
    64 bytes from 203.0.113.103: icmp_req=3 ttl=63 time=1.06 ms
    64 bytes from 203.0.113.103: icmp_req=4 ttl=63 time=0.929 ms
    
    --- 203.0.113.103 ping statistics ---
    4 packets transmitted, 4 received, 0% packet loss, time 3002ms
    rtt min/avg/max/mdev = 0.929/1.539/3.183/0.951 ms
  2. Access your instance using SSH from the controller node or any host on the provider physical network:

    $ ssh cirros@203.0.113.103
    
    The authenticity of host '203.0.113.102 (203.0.113.102)' can't be established.
    RSA key fingerprint is ed:05:e9:e7:52:a0:ff:83:68:94:c7:d1:f2:f8:e2:e9.
    Are you sure you want to continue connecting (yes/no)? yes
    Warning: Permanently added '203.0.113.102' (RSA) to the list of known hosts.
    $

If your instance does not launch or seem to work as you expect, see the Instance Boot Failures section in OpenStack Operations Guide for more information or use one of the many other options <common/app-support> to seek assistance. We want your first installation to work!

Return to Launch an instance <launch-instance-complete>.