Server quick start

To create a server we need to specify what flavor (the specifications of your cloud instance), networks and image we’ll be using

To request a list of available flavors we can use openstack flavor list

$ openstack flavor list

+-------------------+-------------+--------+------+-----------+-------+-----------+
| ID                | Name        |    RAM | Disk | Ephemeral | VCPUs | Is Public |
+-------------------+-------------+--------+------+-----------+-------+-----------+
| 07cc214e-ab6b-40b | xer.small   |   2048 |   32 |        32 |     1 | True      |
| b-99b5-ef05405c4c |             |        |      |           |       |           |
| e1                |             |        |      |           |       |           |
| 08c0c213-ecd0-436 | xer.large   |  32768 |  128 |       128 |     4 | True      |
| 2-a17a-4665ca5a5d |             |        |      |           |       |           |
| 59                |             |        |      |           |       |           |
| 14d4062d-dcd0-457 | xer.2xlarge |  65536 |  256 |       256 |     8 | True      |
| 5-a794-0092c4188c |             |        |      |           |       |           |
| 75                |             |        |      |           |       |           |
| 2ef2fd64-cd3d-488 | xe.medium   |   2048 |   64 |        64 |     2 | True      |
| 2-bc16-f292255378 |             |        |      |           |       |           |
| 50                |             |        |      |           |       |           |
+-------------------+-------------+--------+------+-----------+-------+-----------+

Note: we've truncated the above list for the sake of brevity

Listing available images

Images can similarly be listed

$ openstack image list --limit 2

+--------------------------------------+----------------------+--------+
| ID                                   | Name                 | Status |
+--------------------------------------+----------------------+--------+
| e43d612a-458a-4e1f-8589-d79b652f435c | Ubuntu Focal (20.04) | active |
| b2e9895a-b16a-42a1-87dd-bf13322e382c | Ubuntu Jammy (22.04) | active |
+--------------------------------------+----------------------+--------+

Listing available networks

$ openstack network list

+-----------------------------+-----------------+------------------------------+
| ID                          | Name            | Subnets                      |
+-----------------------------+-----------------+------------------------------+
| e60fa5e3-eadb-4d9d-8cf0-61c | Public Guam     | e6216f13-3214-4120-a9ca-49ce |
| 14648511c                   |                 | f56ac9e9                     |
+-----------------------------+-----------------+------------------------------+

Creating your first server

We now have all the information we need to create our first server!

$ openstack server create "our first server" --flavor xer.small --image c38664dc-0299-4a4b-b0d4-fb48552e68fb --network "Public Guam"

+-----------------------------+-------------------------------------------------------------+
| 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                   | XvhpBhn7Phw5                                                |
| config_drive                |                                                             |
| created                     | 2023-02-08T03:43:36Z                                        |
| flavor                      | xer.small (227e7dec-5556-45df-b69d-c587e26e9e58)            |
| hostId                      |                                                             |
| id                          | 2a504c34-9afe-4dec-ae2e-1845455db9a1                        |
| image                       | Ubuntu Focal (20.04) (e43d612a-458a-4e1f-8589-d79b652f435c) |
| key_name                    | None                                                        |
| name                        | our first server                                            |
| progress                    | 0                                                           |
| project_id                  | 186cea17bc1745deb6a80a203c2483bc                            |
| properties                  |                                                             |
| security_groups             | name='default'                                              |
| status                      | BUILD                                                       |
| updated                     | 2023-02-08T03:43:36Z                                        |
| user_id                     | 7b8b75be73494bb584ce4b9055136297                            |
| volumes_attached            |                                                             |
+-----------------------------+-------------------------------------------------------------+

Note: By default, the default security policy is egress only. To enable ingress, create a new security group with the required rules.

You can learn more about creating security groups in the Official OpenStack Documentation.

We’ll receive the details of our server and that it’s in the BUILD state.

Lets check in on how it’s progressing:


$ openstack server show 2a504c34-9afe-4dec-ae2e-1845455db9a1
+-----------------------------+-------------------------------------------------------------+
| Field                       | Value                                                       |
+-----------------------------+-------------------------------------------------------------+
| OS-DCF:diskConfig           | MANUAL                                                      |
| OS-EXT-AZ:availability_zone | nova                                                        |
| OS-EXT-STS:power_state      | Running                                                     |
| OS-EXT-STS:task_state       | None                                                        |
| OS-EXT-STS:vm_state         | active                                                      |
| OS-SRV-USG:launched_at      | 2023-02-08T03:44:02.000000                                  |
| OS-SRV-USG:terminated_at    | None                                                        |
| accessIPv4                  |                                                             |
| accessIPv6                  |                                                             |
| addresses                   | Public Guam=156.247.206.142                                 |
| config_drive                |                                                             |
| created                     | 2023-02-08T03:43:36Z                                        |
| flavor                      | xer.small (227e7dec-5556-45df-b69d-c587e26e9e58)            |
| hostId                      | 45999336f6665d5c6dd95430384ba687e3e850bf25c81cda05177e9b    |
| id                          | 2a504c34-9afe-4dec-ae2e-1845455db9a1                        |
| image                       | Ubuntu Focal (20.04) (e43d612a-458a-4e1f-8589-d79b652f435c) |
| key_name                    | None                                                        |
| name                        | our first server                                            |
| progress                    | 0                                                           |
| project_id                  | 186cea17bc1745deb6a80a203c2483bc                            |
| properties                  |                                                             |
| security_groups             | name='default'                                              |
| status                      | ACTIVE                                                      |
| updated                     | 2023-02-08T03:44:02Z                                        |
| user_id                     | 7b8b75be73494bb584ce4b9055136297                            |
| volumes_attached            |                                                             |
+-----------------------------+-------------------------------------------------------------+

Our server is now in the ACTIVE state and ready to go! 🥳

Last updated