Differenze tra le versioni di "Cloud-Virtual Machine Management"

Da ISTI S2I2S Wiki.
Jump to navigation Jump to search
 
(18 versioni intermedie di 2 utenti non mostrate)
Riga 2: Riga 2:
 
== Virtual Machines Management using the dashboard ==
 
== 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/
+
The OpenStack dashboard is available at ISTI at the following URL: https://isti-cloud.isti.cnr.it/
  
 
===Launch an instance (which means Create Instance) ===
 
===Launch an instance (which means Create Instance) ===
 +
<gallery>
 +
File:1.png|Left Menu
 +
File:LaunchInstance.png|Launch Instance
 +
</gallery>
  
# From the Compute menu, select Instances
+
# From the Compute menu, select ''Instances''
# Press Launch Instance
+
# Press ''Launch Instance''
 
# Fill the following section
 
# Fill the following section
 +
  
 
'''Details'''
 
'''Details'''
Write the instance name (it's actually a prefix if more than one instance is being lauched), no spaces are allowed
+
        Write the instance name*, no spaces are allowed
Choose the number of instances to launch
+
        Choose as Availability Zone the "cnr-isti-nova-a"
 +
        Choose the number of instances to launch
 +
&#42; it's actually a prefix if more than one instance is being launched
  
 
'''Source'''
 
'''Source'''
Riga 22: Riga 29:
 
'''Flavor'''
 
'''Flavor'''
  
         Select the flavor of the VM. When launching more than one instance, every instance will have the same flavor (and the same OS)
+
         Select the flavor of the VM.*
 +
 
 +
&#42; When launching more than one instance, every instance will have the same flavor (and the same OS)
  
 
'''Network'''
 
'''Network'''
Riga 31: Riga 40:
 
'''Network ports'''
 
'''Network ports'''
  
     Not used by us
+
     Can be skipped
  
 
'''Security groups'''
 
'''Security groups'''
Riga 38: Riga 47:
 
         - select the '''default_for_all''';
 
         - select the '''default_for_all''';
 
         - remove the '''default''' one ;
 
         - remove the '''default''' one ;
        ssh from the VPN gateways and using the proxy jump configuration.
+
        <!--ssh from the VPN gateways and using the proxy jump configuration.
 
         http and https from the load balancers only
 
         http and https from the load balancers only
        <!--port 8100 from the proxy jump host (this is the port we use for the tomcat debugging service)
+
      port 8100 from the proxy jump host (this is the port we use for the tomcat debugging service)
 
         port 9100 from the prometheus server (node exporter)-->
 
         port 9100 from the prometheus server (node exporter)-->
  
Riga 53: Riga 62:
 
'''Scheduler hints'''
 
'''Scheduler hints'''
  
     Not used by us
+
     Can be skipped
  
 
'''Metadata'''
 
'''Metadata'''
  
     Not used by us
+
     Can be skipped
  
  
Riga 63: Riga 72:
  
  
'''Public Ip addresses (Floating IP)'''
+
=== 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.
 
You can now add a public IP address to your instances using the Associate Floating IP item of the menu associated to the VM.
Riga 73: Riga 82:
  
  
'''DNS Zones'''
+
=== DNS Zones ===
 
* Create Record Set;
 
* Create Record Set;
 
* Choose a type A;
 
* Choose a type A;
Riga 82: Riga 91:
 
*  
 
*  
 
and to check the correcteness click on the domain
 
and to check the correcteness click on the domain
 +
 +
== GPU support ==
 +
 +
At the moment the OpenStack@ISTI:
 +
* have 3 servers with 2 GPU each (Nvidia V100 32G) for a total of 6 GPU;
 +
* we support the virtualization of GPU (VGPU);
 +
* we support two dimension for the VGPU: 8G, 16G;
 +
 +
<!--For each server 4*8G and 2*16G GPU.-->
 +
 +
'''IMPORTANT:''' To use the VGPU, a request must be made [https://redmine-s2i2s.isti.cnr.it/projects/supporto-utenti/issues/new?issue%5Btracker_id%5D=6&issue%5Bsubject%5D=Richiesta+di+GPU&issue%5Bassigned_to_id%5D=14&issue%5Bcategory_id%5D=221 HERE]to obtain a license (this can also be done after the VM has been created).
 +
 +
=== Launch an instance with GPU using the dashboard ===
 +
 +
# From the Compute menu, select ''Instances''
 +
# Press ''Launch Instance''
 +
# Fill the following section
 +
 +
'''Details'''
 +
        Write the instance name*, no spaces are allowed
 +
        Choose as Availability Zone the "cnr-isti-nova-a"
 +
        Choose the number of instances to launch
 +
&#42; it's actually a prefix if more than one instance is being launched
 +
 +
'''Source'''
 +
        Select Image as boot source if you don't have the necessity to boot from a existing snapshot
 +
        '''Create New Volume [MANDATORY: select NO]'''
 +
        Choose the Volume size
 +
        Select Yes for Delete Volume on Instance Delete
 +
        '''Select the chosen operating system image [MANDATORY: the image whose name contains VGPU]'''
 +
 +
'''Flavor'''
 +
 +
        Select the flavor of the VM. '''[MANDATORY: for GPU the flavor are vgpu8 for a GPU 8G, and vgpu16 for a GPU 16G]'''
 +
 +
'''Network'''
 +
 +
    Select the PROJECT-main Network
 +
    The public IP addresses can be assigned later
 +
 +
'''Network ports'''
 +
 +
    Can be skipped
 +
 +
'''Security groups'''
 +
 +
If you want you can use the '''default_for_all''' (specified by the cloud administrators):
 +
        - select the '''default_for_all''';
 +
        - remove the '''default''' one ;
 +
        <!--ssh from the VPN gateways and using the proxy jump configuration.
 +
        http and https from the load balancers only
 +
        port 8100 from the proxy jump host (this is the port we use for the tomcat debugging service)
 +
        port 9100 from the prometheus server (node exporter)-->
 +
 +
'''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'''
 +
 +
    Can be skipped
 +
 +
'''Metadata'''
 +
 +
    Can be skipped
 +
 +
 +
'''==>''' Now press '''Launch Instance''' , you'll be redirected to the instances page
  
 
== Virtual Machines Management using the command line ==
 
== Virtual Machines Management using the command line ==
Riga 142: Riga 223:
 
<pre>(openstack-NAME_PROJECT)USERNAME@XXXX:~/$</pre>-->
 
<pre>(openstack-NAME_PROJECT)USERNAME@XXXX:~/$</pre>-->
  
=== Operate the OpenStack regions (connect to OpenStack) ===
+
<!-- == VM creation == <p>TO BE DONE</p>-->
  
==== Create an application credentials to access the OpenStack projects ====
 
  
 +
 +
== How to connect to OpenStack ==
 +
 +
=== Create an application credentials to access the OpenStack projects ===
 +
<gallery>
 +
ApplicationCredentials.png|ApplicationCredentials
 +
 +
</gallery>
 
<ul>
 
<ul>
 
<li><p>From the dashboard follow Identity &gt; Application Credentials &gt; Create Application Credentials<br>
 
<li><p>From the dashboard follow Identity &gt; Application Credentials &gt; Create Application Credentials<br>
Riga 160: Riga 248:
 
* use the following parameter in all the command openstack : ''--os-cloud openstack''
 
* use the following parameter in all the command openstack : ''--os-cloud openstack''
 
* or otherwise set the environment variable export OS_CLOUD=openstack
 
* or otherwise set the environment variable export OS_CLOUD=openstack
 +
 +
 +
  
 
=== Some commands ===
 
=== Some commands ===
Riga 177: Riga 268:
  
 
The documentation of all commands is available at [https://docs.openstack.org/python-openstackclient/wallaby/cli/command-list.html Command list for wallaby]
 
The documentation of all commands is available at [https://docs.openstack.org/python-openstackclient/wallaby/cli/command-list.html Command list for wallaby]
 
== VM creation ==
 
 
<p>TO BE DONE</p>
 

Versione attuale delle 19:07, 12 mar 2026

Virtual Machines Management using the dashboard

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

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*, no spaces are allowed
       Choose as Availability Zone the "cnr-isti-nova-a"
       Choose the number of instances to launch

* it's actually a prefix if more than one instance is being launched

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

   Can be skipped

Security groups

If you want you can use the default_for_all (specified by the cloud administrators):

       - select the default_for_all;
       - remove the default one ;

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

   Can be skipped

Metadata

   Can be skipped


==> 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.


DNS Zones

  • Create Record Set;
  • Choose a type A;
  • Given a name ( add the hostname and the domain (ending with a .));
  • TTL have default 3600;
  • Records had the IP;
  • Press Submit

and to check the correcteness click on the domain

GPU support

At the moment the OpenStack@ISTI:

  • have 3 servers with 2 GPU each (Nvidia V100 32G) for a total of 6 GPU;
  • we support the virtualization of GPU (VGPU);
  • we support two dimension for the VGPU: 8G, 16G;


IMPORTANT: To use the VGPU, a request must be made HEREto obtain a license (this can also be done after the VM has been created).

Launch an instance with GPU using the dashboard

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

Details

       Write the instance name*, no spaces are allowed
       Choose as Availability Zone the "cnr-isti-nova-a"
       Choose the number of instances to launch

* it's actually a prefix if more than one instance is being launched

Source

       Select Image as boot source if you don't have the necessity to boot from a existing snapshot
       Create New Volume [MANDATORY: select NO]
       Choose the Volume size
       Select Yes for Delete Volume on Instance Delete
       Select the chosen operating system image [MANDATORY: the image whose name contains VGPU]

Flavor

       Select the flavor of the VM. [MANDATORY: for GPU the flavor are vgpu8 for a GPU 8G, and vgpu16 for a GPU 16G]

Network

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

Network ports

   Can be skipped

Security groups

If you want you can use the default_for_all (specified by the cloud administrators):

       - select the default_for_all;
       - remove the default one ;

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

   Can be skipped

Metadata

   Can be skipped


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

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



How to 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.

If you use a command from the below and you have this error:

Missing value auth-url required for auth plugin password

You can:

  • use the following parameter in all the command openstack : --os-cloud openstack
  • or otherwise set the environment variable export OS_CLOUD=openstack



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