Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
 eigilo@access:~$ openstack project show PRIV_eigilo
The request you have made requires authentication. (HTTP 401) (Request-ID: req-ec807bd4-bd8e-416b-8e1b-bcaa541b1708)
eigilo@access:~$ source PRIV_eigilo-openrc.sh 
Please enter your OpenStack Password for project PRIV_eigilo as user eigilo: 
eigilo@access:~$ openstack project show PRIV_eigilo
+-------------+----------------------------------+
| Field       | Value                            |
+-------------+----------------------------------+
| description | Eigil's private sandbox          |
| domain_id   | cb782810849b4ce8bce7f078cc193b19 |
| enabled     | True                             |
| id          | 2a4b680765554d728aa2f4d8aadab653 |
| is_domain   | False |
| name | PRIV_eigilo |
| parent_id | cb782810849b4ce8bce7f078cc193b19 |
+                            |
| name        | PRIV_eigilo                      |
| parent_id   | cb782810849b4ce8bce7f078cc193b19 |
+-------------+----------------------------------+

...

Code Block
eigilo@access:~$ openstack keypair create MySecondExistingKey --public-key .ssh/id_rsa.pub
+
+-------------+------------------------------------------------------------------+
| Field       | Value                                                            |
+-------------+------------------------------------------------------------------+
| fingerprint | c7:16:40:92:63:c4:f3:07:bb:43:21:34:82:cb:e9:f8                  |
| name        | MySecondExistingKey                                              |
| user_id     | 1790de92c726dc409c223dcfed7fe2c67d792f3cf8e7f46118e5c2bfd63faff3 |
+-------------+------------------------------------------------------------------+

Creating  a virtual machine

To create a virtual machine you need to decide how powerful it should be, and which image it should be based on. To list the various flavors and images you can use the following commands:

Code Block
eigilo@access:~$ openstack image list
+--------------------------------------+-----------------------------------------+--------+
| ID                                   | Name                                    | Status |
+--------------------------------------+-----------------------------------------+--------+
| 8898ac64-09cd-4f93-a8e0-b6c761b0fbfb | Debian 8.7.0 (Jessie) stable amd64      | active |
   ...   Output is cut for brevity   ...
+--------------------------------------+-----------------------------------------+--------+
eigilo@access:~$ openstack flavor list
+-------------------------------+------------+-------+------+-----------+-------+-----------+
| ID                            | Name       |   RAM | Disk | Ephemeral | VCPUs | Is Public |
+-------------------------------+------------+-------+------+-----------+-------+-----------+
| 0a4b6072-3170-447a-           | m1.tiny    |  1024 |   10 |         0 |     1 | True      |
| 8ac1-89562fd1c042             |            |       |      |           |       |           |
| 41272f0e-d3ff-4fe6-97eb-      | m1.xlarge  | 16384 |   80 |         0 |     8 | True      |
| 3d7e3b60f3fd                  |            |       |      |           |       |           |
| 7d7f1dfe-9af0-48ff-9ecf-      | m1.micro   |   512 |    5 |         0 |     1 | True      |
| 5b501a20b4cb                  |            |       |      |           |       |           |
| f0cc87d7-6683-474f-b1ea-      | m1.2xlarge | 32768 |  100 |         0 |    16 | True      |
| ef4a0660797f                  |            |       |      |           |       |           |
| f2cb5be9-2e41-4c96-a377-25e20 | m1.medium  |  4096 |   40 |         0 |     2 | True      |
| ca611ec                       |            |       |      |           |       |           |
| f5c05713-c2c0-471e-8664-46248 | m1.large   |  8192 |   60 |         0 |     4 | True      |
| 283a6af                       |            |       |      |           |       |           |
| fab9a8bf-8809-4780-90d9-e71e5 | m1.small   |  2048 |   20 |         0 |     1 | True      |
| 0ddf3d7                       |            |       |      |           |       |           |
+-------------------------------+------------+-------+------+-----------+-------+-----------+

The virtual server is then booted using this command:

Code Block
eigilo@access:~$ openstack server create --image 8898ac64-09cd-4f93-a8e0-b6c761b0fbfb --flavor m1.medium --security-group default --key-name MySecondExistingKey --nic net-id=73a1a530-dbdd-47cc-ab89-e5fa8a58aaf3 MySecondServer
+--------------------------------------+----------------------------------------------------+
| Field                                | Value                                              |
+--------------------------------------+----------------------------------------------------+
| OS-DCF:diskConfig                    | MANUAL                                             |
| OS-EXT-AZ:availability_zone          |                                                    |
| OS-EXT-STS:power_state               | NOSTATE                                            |
| OS-EXT-STS:task_state                | scheduling                                         |
| OS-EXT-STS:vm_state                  | building                                           |
| OS-SRV-USG:launched_at               | None                                               |
| OS-SRV-USG:terminated_at             | None                                               |
| accessIPv4                           |                                                    |
| accessIPv6                           |                                                    |
| addresses                            |                                                    |
| adminPass                            | 54SSdRg3coxd                                       |
| config_drive                         |                                                    |
| created                              | 2017-02-02T14:47:24Z                               |
| flavor                               | m1.medium (f2cb5be9-2e41-4c96-a377-25e20ca611ec)   |
| hostId                               |                                                    |
| id                                   | 7fd211d6-ed7b-492a-89cf-1f3fe2cf3bdf               |
| image                                | Debian 8.7.0 (Jessie) stable amd64 (8898ac64-09cd- |
|                                      | 4f93-a8e0-b6c761b0fbfb)                            |
| key_name                             | MySecondExistingKey                                |
| name                                 | MySecondServer                                     |
| os-extended-volumes:volumes_attached | []                                                 |
| progress                             | 0                                                  |
| project_id                           | 2a4b680765554d728aa2f4d8aadab653                   |
| properties                           |                                                    |
| security_groups                      | [{u'name': u'default'}]                            |
| status                               | BUILD                                              |
| updated                              | 2017-02-02T14:47:25Z                               |
| user_id                              | 1790de92c726dc409c223dcfed7fe2c67d792f3cf8e7f46118 |
|                                      | e5c2bfd63faff3                                     |
+--------------------------------------+----------------------------------------------------+

If all is well, the machine should reach the "ACTIVE" state within seconds:

Code Block
 eigilo@access:~$ openstack server list
+---------------------+----------------+--------+---------------------+---------------------+
| FieldID       | Value          | Name           | Status | Networks            | Image     Name                 |
+---------------------+----------------+--------+---------------------+---------------------+
| 7fd211d6-ed7b-492a-----+
| fingerprint | c7:16:40:92:63:c4:f3:07:bb:43:21:34:82:cb:e9:f8 | MySecondServer | ACTIVE | MySecondNetwork=10. | Debian 8.7.0        |
| 89cf-1f3fe2cf3bdf   |                |        | 14.2.12             | (Jessie) stable     |
| name                     |    MySecondExistingKey            |        |                     | amd64    |
| user_id         | 1790de92c726dc409c223dcfed7fe2c67d792f3cf8e7f46118e5c2bfd63faff3 |
+---------------------+----------------+--------+---------------------+---------------------+

Creating  a virtual machine

...

Assigning a floating IP to an instance