Skip to main content

Instance creation

Instance creation could be done easily via OpenStack Horizon from "Launch Instance" button on Project -> Compute -> Instances Panel.

However, you can deploy an instance via OSC with the following steps:

Attention: Be sure to select a security group that allows access to the VM from the Internet or other private networks, especially when a floating IP is assigned to the VM.

List resources names and ids

$ openstack image list
$ openstack flavor list
$ openstack security group list
$ openstack network list
$ openstack keypair list

Keypair creation

Attention: A least one keypair must be created before creating instances, and this keypair must be used to create instances via Horizon or OSC.

$ openstack keypair create --public-key ~/.ssh/id_rsa.pub <keypair-name>

Security Group configuration

You should create a security group with egress traffic allowed and ingress rules which allow access to the instance. Go to the sub-chapter 7.6 Security Group Creation to create a new security group. However, if you want to use the default security group, you should remember that any egress traffic is allowed in “default” security group, but no ingress traffic. Therefore, you should edit the default security group and add the ingress rules that you need. For example:

openstack security group rule create --ingress --proto tcp --remote-ip 0.0.0.0/0 --dst-port 22 default

Instance creation with Non-Persistent storage

$ openstack server create --image <image> --flavor <flavor> --security-group <security-group> --network <network> --key-name <keypair-name> <name>

Instance creation with Persistent storage by creating a new volume

The root volume will not be deleted when the server is deleted. --boot-from-volume is supported from OSC 4.0.0-2 version and later.

$ openstack server create --image <image> --boot-from-volume <volume-size> --flavor <flavor> --security-group <security-group> 
--network <network> --key-name <keypair-name> <name>

Floating IP creation and assignation

$ openstack floating ip create 125-dmz-openstack
$ openstack server add floating ip <server> <floating-ip>

Access to a Rocky Linux VM

$ ssh rocky@<floating-ip>

Access to an Ubuntu VM

$ ssh ubuntu@<floating-ip>