Versions Compared

Key

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

...

Code Block
loginansatt01:~$ openstack subnet create --subnet-range 10192.14168.220.0/24 --network MySecondNetwork MySecondSubnet-v4
+-------------------+-------------------------------------------+
| Field             | Value                                     |
+-------------------+-------------------------------------------+
| allocation_pools  | 10192.14168.220.2-10192.14168.2.254                |
| cidr              | 10192.14268.220.0/24                           |
| created_at        | 2017-02-02T13:52:15Z                      |
| description       |                                           |
| dns_nameservers   |                                           |
| enable_dhcp       | True                                      |
| gateway_ip        | 10192.14168.220.1                              |
| headers           |                                           |
| host_routes       |                                           |
| id                | 10e400ab-bffe-4c3f-8f08-bec9d8e6a81a      |
| ip_version        | 4                                         |
| ipv6_address_mode | None                                      |
| ipv6_ra_mode      | None                                      |
| name              | MySecondSubnet-v4                         |
| network_id        | 73a1a530-dbdd-47cc-ab89-e5fa8a58aaf3      |
| project_id        | 2a4b680765554d728aa2f4d8aadab653          |
| project_id        | 2a4b680765554d728aa2f4d8aadab653          |
| revision_number   | 2                                         |
| service_types     | []                                        |
| subnetpool_id     | None                                      |
| updated_at        | 2017-02-02T13:52:15Z                   |
   |
+-------------------+-------------------------------------------+

At this point the network is created, and this can be verified as so:

...

Here you can see the network created, in addition to the external network "extntnu-netinternal" and the network created in the web-interface based guide.

...

Code Block
loginansatt01:~$ neutronopenstack router set -gateway-set MySecondRouter-external-gateway ntnu-internal
Set gateway for router MySecondRouter MySecondRouter 

The router needs to be connected to the subnet like this:

...

Code Block
loginansatt01:~$ openstack image list
+--------------------------------------+------------------------------------------------------+-------------+
| ID                                   | Name                                                 | Status      |
+--------------------------------------+------------------------------------------------------+-------------+
| 8898ac64db1bc18e-09cd81e3-4f93477e-a8e09067-b6c761b0fbfbeecaa459ec33 | Ubuntu DebianServer 8.7.022.04 LTS (JessieJammy Jellyfish) stable amd64      | active      |
   ...   Output is cut for brevity   ...
+--------------------------------------+-----------------------------------------+--------+
loginansatt01:~$ openstack flavor list
+-----+-------------+

loginansatt01:~$ openstack flavor list
+--------------------------+---------------------+--------+------+-----------+-------+-----------+
| ID                       | Name      |   Name       |    RAM | Disk | Ephemeral | VCPUs | Is Public |
+--------------------------+---------+------------+--------+------+-----------+-------+-----------+
| 0a4b60722295f296-474a-31704249-447a9774- |   gx1.1c2r       | m1.tiny    |  1024 2048 |   1040 |         0 |     1 | True      |
| 8ac1-89562fd1c042ea442b145700             |                     |        |      |           |       |           |
| 41272f0e764f3bb4-d3ff8abb-4fe64806-97eb-b21c- | gx1.1c1r      | m1.xlarge      |   163841024 |   8040 |         0 |     81 | True      |
| 3d7e3b60f3fd0910267b2dad             |         |            |        |      |           |       |           |
| 7d7f1dfe9af88dd9-9af08720-48ff447e-9ecfb0c6- | gx1.1c4r    | m1.micro        |   5124096 |    540 |         0 |     1 | True      |
| 5b501a20b4cb77194cee0749             |         |            |        |      |           |       |           |
| f0cc87d7f087c7cf-66839bbb-474f4730-b1ea826d- | gx1.1c3r            | m1.2xlarge | 327683072 |  100 40 |         0 |    16 1 | True      |
| ef4a0660797f22badb3d8bed             |         |            |        |      |           |       |           |
| f2cb5be95fcfba2c-2e415329-4c9641ba-a3779c22-25e20 | m1.mediumgx1.2c1r            |   40961024 |   40 |         0 |     2 | True      |
| ca611ec38194e89cb49              |         |            |        |      |           |       |           |
| f5c05713644eadfd-c2c01fa6-471e489c-86649f96-46248 | m1.largegx1.2c3r            |  8192 3072 |   6040 |         0 |     42 | True      |
| 283a6af76afb1b8a8b8             |          |           | |       |      |           |       |           |
| fab9a8bf677c0ce0-88091891-47804632-90d9bd27-e71e5 | m1.smallgx3.2c8r            |  2048 8192 |   2040 |         0 |     12 | True      |
| 0ddf3d7da63efbb5530              |         |            |        |      |           |       |           |
+| 931a16c5-fa1e-4f51-----------------------------+------------+-------+8298- | gx1.2c4r            |   4096 |   40 |         0 |     2 | True      |
| 86364b72eb48             |                     |        |      |           |       |           |
    ...   Output is cut for brevity   ... 
+--------+-----------+-------+-------------+---------+-------+------+-----------+-------+-----------+

The virtual server is then booted using this command:

Code Block
loginansatt01:~$ openstack server create --image 8898ac64-09cd-4f93-a8e0-b6c761b0fbfb --flavor m1gx1.medium2c4r --security-group default --key-name MySecondExistingKey --nicnetwork net-id=73a1a530-dbdd-47cc-ab89-e5fa8a58aaf3 MySecondServer
+-----------------------------+-----------+---------------------------------------------------------------+
| Field                       | Value           | Value                                                         |
+-----------------------------+-------------+-------------------------------------------------------------+
| OS-DCF:diskConfig           | MANUAL             | MANUAL                                                      |
| OS-EXT-AZ:availability_zone |         |                                                    |
|              |
| OS-EXT-SRV-STS:power_state ATTR:hostname    | MySecondServer              | NOSTATE                                            |
| OS-EXT-STS:taskpower_state      | NOSTATE                        | scheduling                                         |
| OS-EXT-STS:vmtask_state       | scheduling            | building                                                   |
| OS-SRVEXT-USGSTS:launched_atvm_state         | building                 | None                                               |
| OS-SRV-USG:terminatedlaunched_at      | None       | None                                               |
| accessIPv4             |
| OS-SRV-USG:terminated_at    | None        |                                                    |
| accessIPv6        |
| accessIPv4                  |                                                    |
| addresses                     |
| accessIPv6      |            |                                        |
| adminPass                            | 54SSdRg3coxd    |
| addresses                   |                |
| config_drive                         |                                |
| adminPass                   |
| created JUx2tqiYyExH                             | 2017-02-02T14:47:24Z                               |
| flavorconfig_drive                |               | m1.medium (f2cb5be9-2e41-4c96-a377-25e20ca611ec)   |
| hostId                               |                      |
| created                     | 2023-10-03T08:29:42Z       |
| id                                   | 7fd211d6-ed7b-492a-89cf-1f3fe2cf3bdf          |
| description    |
| image            | None                   | Debian 8.7.0 (Jessie) stable amd64 (8898ac64-09cd- |
|                                      | 4f93-a8e0-b6c761b0fbfb)     |
| flavor                      |
| key_name   disk='40', ephemeral='0',                          | MySecondExistingKey                                |
| name                            | extra_specs.aggregate_instance_extra_specs:node_type='general',    | MySecondServer       |
|                              |
| os-extended-volumes:volumes_attached | [] extra_specs.hw:cpu_cores='1', extra_specs.hw:cpu_sockets='2',            |
|                             | extra_specs.hw:cpu_threads='1', extra_specs.hw_rng:allowed='true',       |
| progress                             | 0 extra_specs.hw_rng:rate_bytes='24',                                      |
|           |
| project_id                 | extra_specs.hw_rng:rate_period='5000',         | 2a4b680765554d728aa2f4d8aadab653                   |
| properties     |
|                      |       | extra_specs.quota:cpu_shares='1024',                                     |
|       |
| security_groups                      | [{u'name': u'default'}]extra_specs.quota:disk_read_iops_sec='300',                              |
| status                               | BUILD| extra_specs.quota:disk_write_iops_sec='300',                              |
|                |
| updated            | extra_specs.trait:HW_CPU_X86_AESNI='required', original_name='gx1.2c4r', |
|                             | 2017-02-02T14:47:25Z ram='4096', swap='0', vcpus='2'                                          |
| user_id hostId                      |                       | 1790de92c726dc409c223dcfed7fe2c67d792f3cf8e7f46118 |
|                                      | e5c2bfd63faff3          |
| id                          |
+ 334c71e1-d750-4b25------------------------------------+----------------------------------------------------+

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

Code Block
loginansatt01:~$ openstack server list
+---------------------+----------------+--------+---------------------+---------------------+
| ID95d6-b21a26844754                                     |
| image                       | Name Ubuntu Server 22.04 LTS (Jammy Jellyfish) amd64           | Status | Networks            | Image Name
|                 |
+---------------------+----------------+--------+---------------------+---------------------+
| 7fd211d6-ed7b-492a- | MySecondServer | ACTIVE | MySecondNetwork=10. | Debian 8.7.0  | (db1bc18e-81e3-477e-9067-eecaa459ec33)     |
| 89cf-1f3fe2cf3bdf   |                |        | 14.2.12  |
| key_name                    | (Jessie) stable MySecondExistingKey                                                      |
| locked                      | False                        |                       |                     |
| amd64locked_reason               | None                                                                     |
| name                        | MySecondServer                                                           |
| progress                    | 0                                                                        |
| project_id                  | 2a4b680765554d728aa2f4d8aadab653                                         |
| properties                  |                                                                          |
| security_groups             | name='cd6ba272-1df3-4767-8330-2e8c4d0679c2'                              |
| server_groups               | []                                                                       |
| status                      | BUILD                                                                    |
| tags                        |                                                                          |
| trusted_image_certificates  | None                                                                     |
| updated                     | 2023-10-03T08:29:43Z                                                     |
| user_id                     | 1790de92c726dc409c223dcfed7fe2c67d792f3cf8e7f46118e5c2bfd63faff3         |
| volumes_attached            |                                                                          |
+-----------------------------+--------------------------------------------------------------------------+ 

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

Code Block
loginansatt01:~$ openstack server list
+------------------------------+------------------+--------+---------------------------------------+--------------------------------+-----------+
| ID                           | Name             | Status | Networks                              | Image                          | Flavor    |
+------------------------------+------------------+--------+---------------------------------------+--------------------------------+-----------+
| 7fd211d6-ed7b-492a-89cf-     | MySecondServer   | ACTIVE | MySecondNetwork=192.168.101.63        | Ubuntu Server 22.04 LTS (Jammy | gx1.2c4r  |
| 1f3fe2cf3bdf                 |                  |        |                                       | Jellyfish) amd64               |           | 
+------------------------------+------------------+--------+---------------------------------------+--------------------------------+-----------+

Assigning a floating IP to an instance

Your freshly made machine lives on your own private network, created by you, and is thus currently unreachable from the rest of the world. To enable outside access to the machine you would need to assign a floating IP address to it.

If this is the first time you use a floating IP, there are probably no IP allocated to your project. To allocate an IP to your project you could use the following command:

Code Block
loginansatt01:~$ openstack floating ip create ntnu-internal
+---------------------+--------------------------------------+
| Field               | Value                                |
+--
+---------------------+-------------------+--------+---------------------+---------+
| created_at          | 2017------------+

Assigning a floating IP to an instance

Your freshly made machine lives on your own private network, created by you, and is thus currently unreachable from the rest of the world. To enable outside access to the machine you would need to assign a floating IP address to it.

If this is the first time you use a floating IP, there are probably no IP allocated to your project. To allocate an IP to your project you could use the following command:

Code Block
loginansatt01:~$ openstack floating ip create ntnu-internal
+---------------------+--------------------------------------+
| Field02-02T14:52:46Z                 |
| description         |                                      |
| fixed_ip_address    | None                                 |
| floating_ip_address | 10.212.136.24                        |
| floating_network_id | 22a507fa-ca51-4b57-bf84-784213917662 |
| headers             |                                      |
| id                  | 1a90e802-5bc4-4997-b255-b2c942cfaa94 |
| port_id             | None                                 |
| project_id Value         | 2a4b680765554d728aa2f4d8aadab653     |
| project_id          | 2a4b680765554d728aa2f4d8aadab653     |
+---------------------+--------------------------------------+
| created_atrevision_number     | 1                  | 2017-02-02T14:52:46Z                 |
| description| router_id           | None     |                            |
| status         |
| fixed_ip_address    | NoneDOWN                                 |
| floating_ip_address | 10.212.136.24  updated_at          | 2017-02-02T14:52:46Z                 |
+---------------------+--------------------------------------+

To show the floating IP's belonging to your project you could list them like so:

Code Block
loginansatt01:~$ openstack floating ip  |
| floating_network_id | 22a507fa-ca51-4b57-bf84-784213917662 |
| headers             |                                      |
| id                  | 1a90e802-5bc4-4997-b255-b2c942cfaa94 |
| port_id             | None                                 |
| project_id list
+------------------------+-----------------------+---------------------+-------------------------+
| ID            | 2a4b680765554d728aa2f4d8aadab653     |
| project_id     | Floating IP Address   | Fixed 2a4b680765554d728aa2f4d8aadab653IP Address    |
| revision_numberPort     | 1              |
+------------------------+-----------------------+---------------------+-------------------------+
| 1a90e802-5bc4-4997-b25 | 10.212.136.21         | None         |
| router_id      | None    | None               |
| 5-b2c942cfaa94         |        |
| status              |  DOWN                   |              |
| updated_at          |
| 20175736b7eb-02-02T14:52:46Z7934-4629     | 10.212.136.20           |
+---------------------+--------------------------------------+

To show the floating IP's belonging to your project you could list them like so:

Code Block
loginansatt01:~$ openstack floating ip list
+------------------------+-----------------------+------------------+-------------------------+
| ID | 192.168.20.105      | 635637c2-b1ca-4759      |
| -921c-8d9cbda9c0af     |                    | Floating IP Address|   | Fixed IP Address | Port             | -8c5b-e7711c667138      |
+------------------------+-----------------------+------------------+---+----------------------+
| 1a90e802-5bc4-4997-b25 | 10.212.136.21         | None             | None                    |
| 5-b2c942cfaa94         |                       |                  |                         |
| 5736b7eb-7934-4629     | 10.212.136.20         | 10.14.1.105      | 635637c2-b1ca-4759      |
| -921c-8d9cbda9c0af     |                       |                  | -8c5b-e7711c667138      |
+------------------------+-----------------------+------------------+-------------------------+

To assign a floating IP to a virtual machine, you would use the following command:

Code Block
loginansatt01:~$ openstack server add floating ip MySecondServer 10.212.136.21

At this point you should be able to ping the server:

Code Block
loginansatt01:~$ ping 10.212.136.21
PING 10.212.136.21 (10.212.136.21) 56(84) bytes of data.
64 bytes from 10.212.136.21: icmp_seq=1 ttl=62 time=3.23 ms
64 bytes from 10.212.136.21: icmp_seq=2 ttl=62 time=1.03 ms
^C
--- 10.212.136.21 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 1.032/2.135/3.238/1.103 ms

And you should be able to log into it, using the private part of the key selected when the server were booted.

Depending on the OS installed, the default user name is different.

...

centos

...

core

...

-+

To assign a floating IP to a virtual machine, you would use the following command:

Code Block
loginansatt01:~$ openstack server add floating ip MySecondServer 10.212.136.21

At this point you should be able to ping the server:

Code Block
loginansatt01:~$ ping 10.212.136.21
PING 10.212.136.21 (10.212.136.21) 56(84) bytes of data.
64 bytes from 10.212.136.21: icmp_seq=1 ttl=62 time=3.23 ms
64 bytes from 10.212.136.21: icmp_seq=2 ttl=62 time=1.03 ms
^C
--- 10.212.136.21 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 1.032/2.135/3.238/1.103 ms

And you should be able to log into it, using the private part of the key selected when the server were booted.

Depending on the OS installed, the default user name is different. See the complete list here


Code Block
loginansatt01:~$ ssh ubuntu@10.212.136.21 -i .ssh/id_rsa
The authenticity of host '10.212.136.21 (10.212.136.21)' can't be established.
ECDSA key fingerprint is SHA256:PIR85mFU0TiOZ0mXHz1ExMvds1D1YO1eF+/TTniAYfo.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '10.212.136.21' (ECDSA) to the list of known hosts.
Welcome to Ubuntu 22.04.1 LTS (GNU/Linux 5.15.0-48-generic x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

  System information as of Tue Oct  3 08:38:59 UTC 2023

  System load:           0.04541015625
  Usage of /:            6.9% of 38.58GB
  Memory usage:          19%
  Swap usage:            0%
  Processes:             101
  Users logged in:       0
  IPv4 address for ens3: 192.168.101.63

 * Strictly confined Kubernetes makes edge and IoT secure. Learn how MicroK8s
   just raised the bar for easy, resilient and secure K8s cluster deployment.

   https://ubuntu.com/engage/secure-kubernetes-at-the-edge

93 updates can be applied immediately.
1 of these updates is a standard security update.
To see these additional updates run: apt list --upgradable


1 updates could not be installed automatically. For more details,
see /var/log/unattended-upgrades/unattended-upgrades.log

*** System restart required ***
Last login: Wed Sep 27 11:42:23 2023 from 2001:700:1d00:13:13c6:b788:b27:a3eb
ubuntu@mysecondserver
Code Block
loginansatt01:~$ ssh debian@10.212.136.21 -i .ssh/id_rsa
The authenticity of host '10.212.136.21 (10.212.136.21)' can't be established.
ECDSA key fingerprint is SHA256:PIR85mFU0TiOZ0mXHz1ExMvds1D1YO1eF+/TTniAYfo.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '10.212.136.21' (ECDSA) to the list of known hosts.
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@mysecondserver:~$