Launch an Instance from the Command Line

Install the OpenStack Command-Line Clients
DreamCompute is powered by OpenStack, so you can manage it with the OpenStack command-line clients. The OpenStack documentation provides instructions for installing the clients on various platforms.

The clients you'll want to install are: nova, neutron, cinder, glance, and keystone.

Set Environment Variables & Authentication
Download your OpenStack RC file from the Dashboard and save it somewhere easily accessible. The OpenStack RC file is used to set environment variables for the command-line clients.

To set the environment variables, you'll need to source the file and supply your password:

$ source demo-openrc.sh

Launch an Ephemeral Instance
Use the nova client to launch an ephemeral instance running Debian, of the size subsonic, and with the default security group:

$ nova boot --poll --flavor subsonic --image Debian-7.0-Wheezy --key-name dreamcompute my-server

Output: +--+--+ | Property                            | Value                                | +--+--+ | status                              | BUILD                                | | updated                             | 2014-06-03T15:30:51Z                 | | OS-EXT-STS:task_state               | scheduling                           | | key_name                            | dreamcompute                         | | image                               | Debian-7.0-Wheezy                    | | hostId                              |                                      | | OS-EXT-STS:vm_state                 | building                             | | OS-SRV-USG:launched_at              | None                                 | | flavor                              | subsonic                             | | id                                  | 19e2e66c-8409-4f4a-8540-81a719d60e6c | | security_groups                     | [{u'name': u'default'}]              | | OS-SRV-USG:terminated_at            | None                                 | | user_id                             | 74054e358cd145879d296ea613dea32b     | | name                                | my-server                            | | adminPass                           | 7gidR4DpNXVx                         | | tenant_id                           | a3373c469b104c3f950ae8c6bca8fd23     | | created                             | 2014-06-03T15:30:50Z                 | | OS-DCF:diskConfig                   | MANUAL                               | | metadata                            | {}                                   | | os-extended-volumes:volumes_attached | []                                  | | accessIPv4                          |                                      | | accessIPv6                          |                                      | | progress                            | 0                                    | | OS-EXT-STS:power_state              | 0                                    | | OS-EXT-AZ:availability_zone         | nova                                 | | config_drive                        |                                      | +--+--+ Instance building... 100% complete Finished

Be sure to use the name of the key you configured in the Dashboard!

Launch an Instance with a Persistent Volume
You can also use the nova client to launch an instance backed by a persistent volume. We'll use the same  command as before, but with different options.

Determine the ID of the image you want to boot. We'll use a Debian image provided by DreamCompute. $ nova image-list

Output: +--+-+++ | ID                                  | Name                | Status | Server | +--+-+++ | 00a06793-0d0f-4aea-9b4d-fe3da02f2ebd | Debian-7.0-Wheezy  | ACTIVE |        | | 762f0267-f98a-4cd8-aa23-99b0f7a67d06 | Fedora-20          | ACTIVE |        | | 8363ff61-55a8-4d4f-9867-fb913e4e5e49 | Ubuntu-14.04-Trusty | ACTIVE |       | +--+-+++

Boot the instance (Documentation for this crazy-long command is here). $ nova boot --poll --flavor subsonic --key-name dreamcompute --block-device source=image,id=00a06793-0d0f-4aea-9b4d-fe3da02f2ebd,dest=volume,size=80,shutdown=preserve,bootindex=0 persistent-server

Output: +--+-+ | Property                            | Value                                           | +--+-+ | status                              | BUILD                                           | | updated                             | 2014-06-03T18:57:21Z                            | | OS-EXT-STS:task_state               | scheduling                                      | | key_name                            | dreamcompute                                    | | image                               | Attempt to boot from volume - no image supplied | | hostId                              |                                                 | | OS-EXT-STS:vm_state                 | building                                        | | OS-SRV-USG:launched_at              | None                                            | | flavor                              | subsonic                                        | | id                                  | 8cd12dcd-b3e0-4efe-bbb2-6fe3aacf9825            | | security_groups                     | [{u'name': u'default'}]                         | | OS-SRV-USG:terminated_at            | None                                            | | user_id                             | 74054e358cd145879d296ea613dea32b                | | name                                | persistent-server                               | | adminPass                           | 39uiKMgH4UhV                                    | | tenant_id                           | a3373c469b104c3f950ae8c6bca8fd23                | | created                             | 2014-06-03T18:57:20Z                            | | OS-DCF:diskConfig                   | MANUAL                                          | | metadata                            | {}                                              | | os-extended-volumes:volumes_attached | []                                             | | accessIPv4                          |                                                 | | accessIPv6                          |                                                 | | progress                            | 0                                               | | OS-EXT-STS:power_state              | 0                                               | | OS-EXT-AZ:availability_zone         | nova                                            | | config_drive                        |                                                 | +--+-+ Instance building... 100% complete Finished

Again, be sure to use the name of the key you configured in the Dashboard!

Associate a Floating IP
You will use the neutron client to associate a floating IP address to your instance. DO NOT use the nova client to do so.

The neutron command you'll use is  so you'll need to find your floating IP ID and the port ID for your instance.

Determine the ID of your available floating IPs: $ neutron floatingip-list

Output: +--+--+-+--+ | id                                  | fixed_ip_address | floating_ip_address | port_id                              | +--+--+-+--+ | 0a88589a-ffac-4193-9a3f-550688b901b5 |                 | 208.113.177.100     |                                      | +--+--+-+--+

Determine the ID of the port for your instance: $ neutron port-list

Output: +--+--+---++ | id                                  | name | mac_address       | fixed_ips                                                                                                      | +--+--+---++ | dea3f5ce-d506-420d-bd8a-5b06cf77e634 |     | fa:16:3e:51:43:c3 | {"subnet_id": "138cdde7-d027-4219-b0f6-039bf28efc5f", "ip_address": "10.10.10.2"}                             | |                                     |      |                   | {"subnet_id": "9410a66b-cf40-47d6-b74e-3f94a3d9660e", "ip_address": "2607:f298:6050:d80e:f816:3eff:fe51:43c3"} | +--+--+---++

Associate the floating IP to the instance port: $ neutron floatingip-associate --fixed-ip-address 10.10.10.2 0a88589a-ffac-4193-9a3f-550688b901b5 dea3f5ce-d506-420d-bd8a-5b06cf77e634

Output: Associated floatingip 0a88589a-ffac-4193-9a3f-550688b901b5

Log In To Your Instance
Now that your instance has an IP address, you can SSH to it. The default user created on DreamCompute instances is named: dhc-user

ssh dhc-user@your-floating-ip-address

That's it, your instance is ready to go!