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

Da ISTI S2I2S Wiki.
Jump to navigation Jump to search
 
(12 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) ===
  
# 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
  
Riga 31: Riga 31:
 
'''Network ports'''
 
'''Network ports'''
  
     Not used by us
+
     Can be skipped
  
 
'''Security groups'''
 
'''Security groups'''
Riga 49: Riga 49:
 
'''Server groups'''
 
'''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
+
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'''
 
'''Scheduler hints'''
  
     Not used by us
+
     Can be skipped
  
 
'''Metadata'''
 
'''Metadata'''
  
     Not used by us
+
     Can be skipped
  
  
Riga 66: Riga 66:
  
 
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.
 
  
 
''Important : in the ISTI infrastructure, you can associate a FQDN to the floating IP address.
 
''Important : in the ISTI infrastructure, you can associate a FQDN to the floating IP address.
Riga 72: Riga 71:
 
Note that the operation gives back an error, but the operation still completes successfully.
 
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.''
 
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
  
 
== Virtual Machines Management using the command line ==
 
== Virtual Machines Management using the command line ==
Riga 129: Riga 139:
 
</blockquote>
 
</blockquote>
  
<p>Your prompt will change putting before your default prompt the prefix (openstack-NAME_PROJECT)</p>
+
<!--<p>Your prompt will change putting before your default prompt the prefix (openstack-NAME_PROJECT)</p>
<pre>(openstack-NAME_PROJECT)USERNAME@XXXX:~/$</pre>
+
<pre>(openstack-NAME_PROJECT)USERNAME@XXXX:~/$</pre>-->
  
 
=== Operate the OpenStack regions (connect to OpenStack) ===
 
=== Operate the OpenStack regions (connect to OpenStack) ===
Riga 142: Riga 152:
 
<li><p>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.</p></li>
 
<li><p>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.</p></li>
 
</ul>
 
</ul>
 +
If you use a command from the below and you have this error:<br>
  
 +
''Missing value auth-url required for auth plugin password''
 +
 +
You can:<br>
 +
 +
* use the following parameter in all the command openstack : ''--os-cloud openstack''
 +
* or otherwise set the environment variable export OS_CLOUD=openstack
  
 
=== Some commands ===
 
=== Some commands ===
Riga 160: Riga 177:
  
 
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 ==
 
== VM creation ==
  
 
<p>TO BE DONE</p>
 
<p>TO BE DONE</p>
 +
 +
== 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, and we support two dimension GPU 8G, GPU 16G, which means we have for each server 4*8G and 2*16G GPU.
 +
 +
== Virtual Machines Management with GPU using the dashboard ==
 +
 +
===Launch an instance (which means Create Instance) ===
 +
 +
# From the Compute menu, select ''Instances''
 +
# Press ''Launch Instance''
 +
# 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
 +
        '''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
 +
 +
 +
'''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

Versione attuale delle 13:06, 18 ott 2024

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 (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

   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

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

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


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.

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

VM creation

TO BE DONE

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, and we support two dimension GPU 8G, GPU 16G, which means we have for each server 4*8G and 2*16G GPU.

Virtual Machines Management with GPU using the dashboard

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

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