Instance creation
Instance creation could be done easily via Red Hat OpenStack Horizon from "Launch Instance" button on Project -> Compute -> Instances Panel.
However, you can deploy an instance via OSC with the following steps:
warning
Be sure to select the sg_projectname 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.
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 sotrage by creating a new volume
info
The root volume will not be deleted when the server is deleted
$ openstack server create --image <image> --boot-from-volume <volume-size> --flavor <flavor> --security-group <security-group>
--network <network> --key-name <keypair-name> <name>
<image>: Specify the image ID or name you want to use.<volume-size>: Define the size of the boot volume in GB.<flavor>: Choose the flavor ID or name that fits your instance requirements.<security-group>: Indicate the security group to apply. (By default must besg_projectname)<network>: Provide the network ID or name to connect the instance to.<keypair-name>: Enter the name of the key pair for SSH access.<name>: Name your instance.
Example
openstack server create --image ubuntu-22.04 --boot-from-volume 20 --flavor std1_2 --security-group sg_projectname --network nw_int_projectname --key-name mykeypair myinstance
Floating IP creation and assignation
info
The external network to use is the one requested during the creation of the project from the service desk form.
You can list the name with the command openstack network list --external
$ openstack floating ip create <external-network>
$ openstack server add floating ip <server> <floating-ip>
Access to an Ubuntu VM
$ ssh ubuntu@<floating-ip>