Cloud-Virtual Machine Management

Da ISTI S2I2S Wiki.
Jump to navigation Jump to search

Virtual Machines Management using the dashboard

The OpenStack dashboard is available at ISTI at the following URL: https://isti-cloud.isti.cnr.it/dashboard/project/

Launch an instance (which means Create Instance)

  1. From the Compute menu, select Instances
  2. Press Launch Instance
  3. Fill the following section

Details Write the instance name (it's actually a prefix if more than one instance is being lauched), no spaces are allowed Choose the number of instances to launch

Source

       Select Image as boot source if you don't have the necessity to boot from a existing snapshot
       Choose the Volume size
       Select Yes for Delete Volume on Instance Delete
       Select the chosen operating system image

Flavor

       Select the flavor of the VM. When launching more than one instance, every instance will have the same flavor (and the same OS)

Network

   Select the PROJECT-main Network
   The public IP addresses can be assigned later

Network ports

   Not used by us

Security groups

   @ISTI The default one opens:
       ssh from the VPN gateways and using the proxy jump configuration.
       http and https from the load balancers only

Key Pair

   Select your key pair. You can create or import one if it's not present already

Server groups

   They can optionally be used to equally distribute the VMs on the hypervisor. They must be created in advance, from the Compute -> Server Groups menu

Scheduler hints

   Not used by us

Metadata

   Not used by us


==> Now press Launch Instance , you'll be redirected to the instances page


Public Ip addresses (Floating IP)

You can now add a public IP address to your instances using the Associate Floating IP item of the menu associated to the VM.


Important : in the ISTI infrastructure, you can associate a FQDN to the floating IP address. You have to add the hostname and the domain (ending with a .) in the form used to allocate the floating IP addresses. Note that the operation gives back an error, but the operation still completes successfully. If you are unsure about the domain name, you can find it in the DNS -> Zones menu.

Virtual Machines Management using the command line

Configure the command line

  • The OpenStack client SDK must be installed (python3-openstackclient).

N.B: Python 3.8+ is required.

Install Python 3 in Mac Os

brew install python@3.10

Install Python 3 in Ubuntu

apt install python3.10 python3.10-dev python3-pip python3.10-venv 
pip install pyproject-toml
  • Create a virtualenv, enable it, and then install the following packages:
python3 -m venv ~/openstack
source ~/openstack/bin/activate
pip install pip --upgrade
pip install python-openstackclient
pip install python-barbicanclient
pip install python-designateclient
pip install python-glanceclient
pip install python-heatclient
pip install python-magnumclient
pip install python-neutronclient
pip install python-novaclient
pip install python-swiftclient
pip install python-octaviaclient
  • To use the client OpenStack enable the virtualenv
source ~/openstack/bin/activate

Your prompt will change putting before your default prompt the prefix (openstack-NAME_PROJECT)

(openstack-NAME_PROJECT)USERNAME@XXXX:~/$

Operate the OpenStack regions (connect to OpenStack)

Create an application credentials to access the OpenStack projects

  • From the dashboard follow Identity > Application Credentials > Create Application Credentials
    pay attention to the expiry date and set it to a reasonable value, e.g. 6/12 months

  • Immediately download the clouds.yaml

  • The file must be saved in home fo the user as ~/.config/openstack/clouds.yaml. If a file exists already, the configuration must be appended and renamed.


Some commands

openstack server list
openstack image list
openstack network list
openstack volume list
openstack floating ip pool list
openstack floating ip list
openstack security group list
openstack server add floating ip INSTANCE_NAME_OR_ID FLOATING_IP_ADDRESS
openstack volume list
openstack port list
openstack server add volume INSTANCE_NAME VOLUME_NAME

The documentation of all commands is available at Command list for wallaby


VM creation

TO BE DONE