Thursday, December 4, 2025

OpenStack Epoxy : Create Instances

 


OpenStack Epoxy : Create Instances

 

Create and Start Virtual Machine Instances.

[1]Login as a user that you set environment variables for Openstack and then create and start virtual machine instance.
# confirm available [flavor] list

debian@dlp ~(keystone)$ 
openstack flavor list

+----+-----------+-------+------+-----------+-------+-----------+
| ID | Name      |   RAM | Disk | Ephemeral | VCPUs | Is Public |
+----+-----------+-------+------+-----------+-------+-----------+
| 1  | m1.tiny   |  2048 |   10 |         0 |     1 | True      |
| 2  | m1.small  |  4096 |   10 |         0 |     2 | True      |
| 3  | m1.medium |  8192 |   10 |         0 |     4 | True      |
| 4  | m1.large  | 16384 |   10 |         0 |     8 | True      |
| 5  | m2.medium |  8192 |   10 |        10 |     4 | True      |
+----+-----------+-------+------+-----------+-------+-----------+

# confirm available image list

debian@dlp ~(keystone)$ 
openstack image list

+--------------------------------------+----------+--------+
| ID                                   | Name     | Status |
+--------------------------------------+----------+--------+
| 33def798-3361-483b-9de1-8c2c6e1c840c | Debian13 | active |
+--------------------------------------+----------+--------+

# confirm available network list

debian@dlp ~(keystone)$ 
openstack network list

+--------------------------------------+------------+--------------------------------------+
| ID                                   | Name       | Subnets                              |
+--------------------------------------+------------+--------------------------------------+
| c4512c41-5546-4278-ba53-31ba2f1526d0 | sharednet1 | b5a506f1-9e50-41d8-b552-1edb595da813 |
+--------------------------------------+------------+--------------------------------------+

# create a security group for instances

debian@dlp ~(keystone)$ 
openstack security group create secgroup01

+-----------------+---------------------------------------------------------------------------+
| Field           | Value                                                                     |
+-----------------+---------------------------------------------------------------------------+
| created_at      | 2025-08-27T06:05:00Z                                                      |
| description     | secgroup01                                                                |
| id              | bff3e8dd-5587-44f8-9d72-c1da4d944f85                                      |
| name            | secgroup01                                                                |
| project_id      | ecfa98ba82de421e8f16c3d862b5ab04                                          |
| revision_number | 1                                                                         |
| rules           | created_at='2025-08-27T06:05:00Z', direction='egress', ethertype='IPv4',  |
|                 | id='76cf83b9-31b2-4f5f-a742-56091e8191fa', standard_attr_id='22', upda... |
|                 | created_at='2025-08-27T06:05:00Z', direction='egress', ethertype='IPv6',  |
|                 | id='af56af85-d19e-4c6c-808f-78eda34e57e6', standard_attr_id='21', upda... |
| shared          | False                                                                     |
| stateful        | True                                                                      |
| tags            | []                                                                        |
| updated_at      | 2025-08-27T06:05:00Z                                                      |
+-----------------+---------------------------------------------------------------------------+

debian@dlp ~(keystone)$ 
openstack security group list

+--------------------------------------+------------+------------------------+----------------------------------+------+
| ID                                   | Name       | Description            | Project                          | Tags |
+--------------------------------------+------------+------------------------+----------------------------------+------+
| ae0ab53e-f713-42d5-9840-8932856db558 | default    | Default security group | ecfa98ba82de421e8f16c3d862b5ab04 | []   |
| bff3e8dd-5587-44f8-9d72-c1da4d944f85 | secgroup01 | secgroup01             | ecfa98ba82de421e8f16c3d862b5ab04 | []   |
+--------------------------------------+------------+------------------------+----------------------------------+------+

# create an SSH keypair for connecting to instances

debian@dlp ~(keystone)$ 
ssh-keygen -q -N ""

Enter file in which to save the key (/home/debian/.ssh/id_ed25519):
# add public-key

debian@dlp ~(keystone)$ 
openstack keypair create --public-key ~/.ssh/id_ed25519.pub mykey

+-------------+-------------------------------------------------+
| Field       | Value                                           |
+-------------+-------------------------------------------------+
| created_at  | None                                            |
| fingerprint | c2:e9:16:1d:5a:5a:f5:4a:b6:c4:0a:27:2a:a4:dc:24 |
| id          | mykey                                           |
| is_deleted  | None                                            |
| name        | mykey                                           |
| type        | ssh                                             |
| user_id     | da64c3c335434563b66eb2e8af260392                |
+-------------+-------------------------------------------------+

debian@dlp ~(keystone)$ 
openstack keypair list

+-------+-------------------------------------------------+------+
| Name  | Fingerprint                                     | Type |
+-------+-------------------------------------------------+------+
| mykey | c2:e9:16:1d:5a:5a:f5:4a:b6:c4:0a:27:2a:a4:dc:24 | ssh  |
+-------+-------------------------------------------------+------+

debian@dlp ~(keystone)$ 
netID=$(openstack network list | grep sharednet1 | awk '{ print $2 }')

# create and start instance

debian@dlp ~(keystone)$ 
openstack server create --flavor m1.small --image Debian13 --security-group secgroup01 --nic net-id=$netID --key-name mykey Debian-13
+-------------------------------------+---------------------------------------------------------+
| Field                               | Value                                                   |
+-------------------------------------+---------------------------------------------------------+
| OS-DCF:diskConfig                   | MANUAL                                                  |
| OS-EXT-AZ:availability_zone         | None                                                    |
| OS-EXT-SRV-ATTR:host                | None                                                    |
| OS-EXT-SRV-ATTR:hostname            | debian-13                                               |
| OS-EXT-SRV-ATTR:hypervisor_hostname | None                                                    |
| OS-EXT-SRV-ATTR:instance_name       | None                                                    |
| OS-EXT-SRV-ATTR:kernel_id           | None                                                    |
| OS-EXT-SRV-ATTR:launch_index        | None                                                    |
| OS-EXT-SRV-ATTR:ramdisk_id          | None                                                    |
| OS-EXT-SRV-ATTR:reservation_id      | None                                                    |
| OS-EXT-SRV-ATTR:root_device_name    | None                                                    |
| OS-EXT-SRV-ATTR:user_data           | None                                                    |
| OS-EXT-STS:power_state              | N/A                                                     |
| 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                          | None                                                    |
| accessIPv6                          | None                                                    |
| addresses                           | N/A                                                     |
| adminPass                           | qXo768QWaPaN                                            |
| config_drive                        | None                                                    |
| created                             | 2025-08-27T06:19:28Z                                    |
| description                         | None                                                    |
| flavor                              | description=, disk='10', ephemeral='0', , id='m1.sma... |
|                                     | is_public='True', location=, name='m1.small', origin... |
|                                     | rxtx_factor=, swap='0', vcpus='2'                       |
| hostId                              | None                                                    |
| host_status                         | None                                                    |
| id                                  | 5eaa74ea-6fc6-4c24-b758-37eaad533c88                    |
| image                               | Debian13 (33def798-3361-483b-9de1-8c2c6e1c840c)         |
| key_name                            | mykey                                                   |
| locked                              | None                                                    |
| locked_reason                       | None                                                    |
| name                                | Debian-13                                               |
| pinned_availability_zone            | None                                                    |
| progress                            | None                                                    |
| project_id                          | ecfa98ba82de421e8f16c3d862b5ab04                        |
| properties                          | None                                                    |
| security_groups                     | name='bff3e8dd-5587-44f8-9d72-c1da4d944f85'             |
| server_groups                       | None                                                    |
| status                              | BUILD                                                   |
| tags                                |                                                         |
| trusted_image_certificates          | None                                                    |
| updated                             | 2025-08-27T06:19:28Z                                    |
| user_id                             | da64c3c335434563b66eb2e8af260392                        |
| volumes_attached                    |                                                         |
+-------------------------------------+---------------------------------------------------------+

# verify status (it shows [BUILD] for a while)

debian@dlp ~(keystone)$ 
openstack server list

+--------------------------------------+-----------+--------+----------+----------+----------+
| ID                                   | Name      | Status | Networks | Image    | Flavor   |
+--------------------------------------+-----------+--------+----------+----------+----------+
| 5eaa74ea-6fc6-4c24-b758-37eaad533c88 | Debian-13 | BUILD  |          | Debian13 | m1.small |
+--------------------------------------+-----------+--------+----------+----------+----------+

# when starting normally, the status turns to [ACTIVE]

debian@dlp ~(keystone)$ 
openstack server list

+--------------------------------------+-----------+--------+-----------------------+----------+----------+
| ID                                   | Name      | Status | Networks              | Image    | Flavor   |
+--------------------------------------+-----------+--------+-----------------------+----------+----------+
| 5eaa74ea-6fc6-4c24-b758-37eaad533c88 | Debian-13 | ACTIVE | sharednet1=10.0.0.247 | Debian13 | m1.small |
+--------------------------------------+-----------+--------+-----------------------+----------+----------+
[2]Configure security settings for the security group you created above to access with SSH and ICMP.
# permit ICMP

debian@dlp ~(keystone)$ 
openstack security group rule create --protocol icmp --ingress secgroup01

+-------------------------+--------------------------------------+
| Field                   | Value                                |
+-------------------------+--------------------------------------+
| belongs_to_default_sg   | False                                |
| created_at              | 2025-08-27T06:07:54Z                 |
| description             |                                      |
| direction               | ingress                              |
| ether_type              | IPv4                                 |
| id                      | 2ec80428-fe6b-409d-944c-dd0603a9e25f |
| name                    | None                                 |
| normalized_cidr         | 0.0.0.0/0                            |
| port_range_max          | None                                 |
| port_range_min          | None                                 |
| project_id              | ecfa98ba82de421e8f16c3d862b5ab04     |
| protocol                | icmp                                 |
| remote_address_group_id | None                                 |
| remote_group_id         | None                                 |
| remote_ip_prefix        | 0.0.0.0/0                            |
| revision_number         | 0                                    |
| security_group_id       | bff3e8dd-5587-44f8-9d72-c1da4d944f85 |
| tags                    | []                                   |
| updated_at              | 2025-08-27T06:07:54Z                 |
+-------------------------+--------------------------------------+

# permit SSH

debian@dlp ~(keystone)$ 
openstack security group rule create --protocol tcp --dst-port 22:22 secgroup01

+-------------------------+--------------------------------------+
| Field                   | Value                                |
+-------------------------+--------------------------------------+
| belongs_to_default_sg   | False                                |
| created_at              | 2025-08-27T06:08:11Z                 |
| description             |                                      |
| direction               | ingress                              |
| ether_type              | IPv4                                 |
| id                      | 09814a39-e152-4d73-a808-5353897894a3 |
| name                    | None                                 |
| normalized_cidr         | 0.0.0.0/0                            |
| port_range_max          | 22                                   |
| port_range_min          | 22                                   |
| project_id              | ecfa98ba82de421e8f16c3d862b5ab04     |
| protocol                | tcp                                  |
| remote_address_group_id | None                                 |
| remote_group_id         | None                                 |
| remote_ip_prefix        | 0.0.0.0/0                            |
| revision_number         | 0                                    |
| security_group_id       | bff3e8dd-5587-44f8-9d72-c1da4d944f85 |
| tags                    | []                                   |
| updated_at              | 2025-08-27T06:08:11Z                 |
+-------------------------+--------------------------------------+

debian@dlp ~(keystone)$ 
openstack security group rule list secgroup01

+--------------------+-------------+-----------+-----------+------------+-----------+-----------------------+----------------------+
| ID                 | IP Protocol | Ethertype | IP Range  | Port Range | Direction | Remote Security Group | Remote Address Group |
+--------------------+-------------+-----------+-----------+------------+-----------+-----------------------+----------------------+
| 09814a39-e152-     | tcp         | IPv4      | 0.0.0.0/0 | 22:22      | ingress   | None                  | None                 |
| 4d73-a808-         |             |           |           |            |           |                       |                      |
| 5353897894a3       |             |           |           |            |           |                       |                      |
| 2ec80428-fe6b-     | icmp        | IPv4      | 0.0.0.0/0 |            | ingress   | None                  | None                 |
| 409d-944c-         |             |           |           |            |           |                       |                      |
| dd0603a9e25f       |             |           |           |            |           |                       |                      |
| 76cf83b9-31b2-     | None        | IPv4      | 0.0.0.0/0 |            | egress    | None                  | None                 |
| 4f5f-a742-         |             |           |           |            |           |                       |                      |
| 56091e8191fa       |             |           |           |            |           |                       |                      |
| af56af85-d19e-     | None        | IPv6      | ::/0      |            | egress    | None                  | None                 |
| 4c6c-808f-         |             |           |           |            |           |                       |                      |
| 78eda34e57e6       |             |           |           |            |           |                       |                      |
+--------------------+-------------+-----------+-----------+------------+-----------+-----------------------+----------------------+
[3]Login to the instance with SSH.
debian@dlp ~(keystone)$ 
openstack server list

+--------------------------------------+-----------+--------+-----------------------+----------+----------+
| ID                                   | Name      | Status | Networks              | Image    | Flavor   |
+--------------------------------------+-----------+--------+-----------------------+----------+----------+
| 5eaa74ea-6fc6-4c24-b758-37eaad533c88 | Debian-13 | ACTIVE | sharednet1=10.0.0.247 | Debian13 | m1.small |
+--------------------------------------+-----------+--------+-----------------------+----------+----------+

debian@dlp ~(keystone)$ 
ping 10.0.0.247 -c3

PING 10.0.0.247 (10.0.0.247) 56(84) bytes of data.
64 bytes from 10.0.0.247: icmp_seq=1 ttl=64 time=1.17 ms
64 bytes from 10.0.0.247: icmp_seq=2 ttl=64 time=0.597 ms
64 bytes from 10.0.0.247: icmp_seq=3 ttl=64 time=0.443 ms

--- 10.0.0.247 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2011ms
rtt min/avg/max/mdev = 0.443/0.735/1.166/0.310 ms

debian@dlp ~(keystone)$ 
ssh debian@10.0.0.247
The authenticity of host '10.0.0.247 (10.0.0.247)' can't be established.
ED25519 key fingerprint is SHA256:2qAHmI7eJ3zvhADBVf4mnMlg8cY9uGz7fJi96ESeXO4.
This key is not known by any other names.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '10.0.0.247' (ED25519) to the list of known hosts.
Linux debian-13 6.12.41+deb13-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.12.41-1 (2025-08-12) x86_64

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
debian@debian-13:~$     # logined
[4]If you'd like to stop an instance, it's possible to control with openstack command like follows.
debian@dlp ~(keystone)$ 
openstack server list

+--------------------------------------+-----------+--------+-----------------------+----------+----------+
| ID                                   | Name      | Status | Networks              | Image    | Flavor   |
+--------------------------------------+-----------+--------+-----------------------+----------+----------+
| 5eaa74ea-6fc6-4c24-b758-37eaad533c88 | Debian-13 | ACTIVE | sharednet1=10.0.0.247 | Debian13 | m1.small |
+--------------------------------------+-----------+--------+-----------------------+----------+----------+

# stop instance

debian@dlp ~(keystone)$ 
openstack server stop Debian-13

debian@dlp ~(keystone)$ 
openstack server list

+--------------------------------------+-----------+---------+-----------------------+----------+----------+
| ID                                   | Name      | Status  | Networks              | Image    | Flavor   |
+--------------------------------------+-----------+---------+-----------------------+----------+----------+
| 5eaa74ea-6fc6-4c24-b758-37eaad533c88 | Debian-13 | SHUTOFF | sharednet1=10.0.0.247 | Debian13 | m1.small |
+--------------------------------------+-----------+---------+-----------------------+----------+----------+

# start instance

debian@dlp ~(keystone)$ 
openstack server start Debian-13

debian@dlp ~(keystone)$ 
openstack server list

+--------------------------------------+-----------+--------+-----------------------+----------+----------+
| ID                                   | Name      | Status | Networks              | Image    | Flavor   |
+--------------------------------------+-----------+--------+-----------------------+----------+----------+
| 5eaa74ea-6fc6-4c24-b758-37eaad533c88 | Debian-13 | ACTIVE | sharednet1=10.0.0.247 | Debian13 | m1.small |
+--------------------------------------+-----------+--------+-----------------------+----------+----------+
[5]It's possible to access with Web browser to get VNC console.
debian@dlp ~(keystone)$ 
openstack server list

+--------------------------------------+-----------+--------+-----------------------+----------+----------+
| ID                                   | Name      | Status | Networks              | Image    | Flavor   |
+--------------------------------------+-----------+--------+-----------------------+----------+----------+
| 5eaa74ea-6fc6-4c24-b758-37eaad533c88 | Debian-13 | ACTIVE | sharednet1=10.0.0.247 | Debian13 | m1.small |
+--------------------------------------+-----------+--------+-----------------------+----------+----------+

debian@dlp ~(keystone)$ 
openstack console url show Debian-13

+----------+-----------------------------------------------------------------------------------------------+
| Field    | Value                                                                                         |
+----------+-----------------------------------------------------------------------------------------------+
| protocol | vnc                                                                                           |
| type     | novnc                                                                                         |
| url      | https://dlp.srv.world:6080/vnc_auto.html?path=%3Ftoken%3Da901b1aa-95ac-424e-92b6-50c0600965cf |
+----------+-----------------------------------------------------------------------------------------------+
[6]Access to the URL which was displayed by the command above.
Matched Content

No comments:

Post a Comment