Differences

This shows you the differences between two versions of the page.

Link to this comparison view

scgc:laboratoare:00 [2021/10/13 16:17]
maria.mihailescu [Lab Setup]
scgc:laboratoare:00 [2021/10/13 17:26] (current)
maria.mihailescu [6. Delete the virtual machine]
Line 11: Line 11:
 The faculty'​s cloud uses [[https://​www.openstack.org/​|Openstack]] to provide students with the ability to create and configure virtual machines in the faculty'​s cluster. The faculty'​s cloud uses [[https://​www.openstack.org/​|Openstack]] to provide students with the ability to create and configure virtual machines in the faculty'​s cluster.
  
-Connect to Horizon, the web front-end of Openstack, at [[https://​cloud-controller.grid.pub.ro/​]] and authenticate using your LDAP username and password (LDAP is used to centrally authenticate across all UPB services; we will go into more details about how LDAP can be configured in [[scgc:​laboratoare:​02]]). Most labs will rely on interacting with Openstack using Horizon.+Connect to Horizon, the web front-end of Openstack, at [[https://​cloud.grid.pub.ro/​]] and authenticate using your LDAP username and password (LDAP is used to centrally authenticate across all UPB services; we will go into more details about how LDAP can be configured in [[scgc:​laboratoare:​02]]). Most labs will rely on interacting with Openstack using Horizon.
  
 Most virtual machine images (base virtual disks) use [[https://​cloudinit.readthedocs.io/​en/​latest/​|cloud-init]] to automatically configure the virtual machine. As part of the first run of the virtual machine, cloud-init will re-generate SSH host keys, reset the default user's password to an invalid value (and usually make them a sudoer without requiring the password), disable root login, and inject the user's keys into the virtual machine. Most virtual machine images (base virtual disks) use [[https://​cloudinit.readthedocs.io/​en/​latest/​|cloud-init]] to automatically configure the virtual machine. As part of the first run of the virtual machine, cloud-init will re-generate SSH host keys, reset the default user's password to an invalid value (and usually make them a sudoer without requiring the password), disable root login, and inject the user's keys into the virtual machine.
  
-We will use ''​fep.grid.pub.ro''​ as a proxy for our connections to the virtual machines. You can connect to fep using ''​ssh user.name@fep.grid.pub.ro''​ and entering the LDAP password of your account when prompted.+We will use ''​fep8.grid.pub.ro''​ as a proxy for our connections to the virtual machines. You can connect to fep using ''​ssh user.name@fep8.grid.pub.ro''​ and entering the LDAP password of your account when prompted.
  
-We also recommend using ''​-o ServerAliveInterval=100''​ to instruct the SSH client to send beacons to the server every 100 seconds, so you do not get disconnected due to inactivity, and ''​-X''​ for X11 forwarding (we will use this option later); the final command looks like ''​ssh user.name@fep.grid.pub.ro -X -o ServerAliveInterval=100''​. The short format will likely be enough in most cases.+We also recommend using ''​-o ServerAliveInterval=100''​ to instruct the SSH client to send beacons to the server every 100 seconds, so you do not get disconnected due to inactivity, and ''​-X''​ for X11 forwarding (we will use this option later); the final command looks like ''​ssh user.name@fep8.grid.pub.ro -X -o ServerAliveInterval=100''​. The short format will likely be enough in most cases.
  
 <note important>​ <note important>​
Line 23: Line 23:
 </​note>​ </​note>​
  
-==== 1. [10p] SSH key pair generation ====+==== 1. SSH key pair generation ====
  
 Because the virtual machine'​s user's password is reset to an invalid value by cloud-init, you will not be able to log into the virtual machine using password login. Instead, you must first create an SSH key that will be automatically added to the virtual machine'​s default user's authorized key. Because the virtual machine'​s user's password is reset to an invalid value by cloud-init, you will not be able to log into the virtual machine using password login. Instead, you must first create an SSH key that will be automatically added to the virtual machine'​s default user's authorized key.
Line 43: Line 43:
 {{ :​scgc:​laboratoare:​openstack-key-import.png?​700 }} {{ :​scgc:​laboratoare:​openstack-key-import.png?​700 }}
  
-==== 2. [10p] Create virtual machines ====+==== 2. Create virtual machines ====
  
 Now that the SSH key pair is available, we can start creating virtual machines. Note that you can only use a limited amount of total resources. You can see graphs of the total amount of resources you can use, and the amount of resources you have used so far through the Horizon interface, in the ''​Project''​ > ''​Compute''​ > ''​Overview''​ section. In the image below, resources are limited to 4 CPU cores and 4GB of RAM. Now that the SSH key pair is available, we can start creating virtual machines. Note that you can only use a limited amount of total resources. You can see graphs of the total amount of resources you can use, and the amount of resources you have used so far through the Horizon interface, in the ''​Project''​ > ''​Compute''​ > ''​Overview''​ section. In the image below, resources are limited to 4 CPU cores and 4GB of RAM.
Line 107: Line 107:
 </​note>​ </​note>​
  
-==== 3. [20p] Connect to the virtual machine ====+==== 3. Connect to the virtual machine ====
 The picture bellow shows how you can connect to the virtual machine. Since the virtual machine runs in OpenStack (i.e. in the faculty'​s cluster) and the assigned IP address is a private address, you cannot directly connect to the virtual machine. ​ The picture bellow shows how you can connect to the virtual machine. Since the virtual machine runs in OpenStack (i.e. in the faculty'​s cluster) and the assigned IP address is a private address, you cannot directly connect to the virtual machine. ​
  
Line 155: Line 155:
 </​code>​ </​code>​
  
-==== 4. [30p] Connect to the virtual machine with X forwarding ====+==== 4. Connect to the virtual machine with X forwarding ====
 Linux uses a client-server architecture for the X window system. SSH allows you to forward graphical applications information through the X11 forwarding functionality. Linux uses a client-server architecture for the X window system. SSH allows you to forward graphical applications information through the X11 forwarding functionality.
  
Line 181: Line 181:
 student@scgc-lab00:​~$ xclock student@scgc-lab00:​~$ xclock
 </​code>​ </​code>​
-==== 5. [20p] Connect to someone else's virtual machine ====+<​hidden>​ 
 +==== 5. Connect to someone else's virtual machine ====
 Partner up with someone else in the lab. Create a simple simple message server using ''​netcat''​ to listen to port ''​8890''​. Ask your partner to connect to your client and also try to connect to their server. You will need two terminals to perform this.  Partner up with someone else in the lab. Create a simple simple message server using ''​netcat''​ to listen to port ''​8890''​. Ask your partner to connect to your client and also try to connect to their server. You will need two terminals to perform this. 
  
Line 209: Line 210:
  
 {{ :​scgc:​laboratoare:​openstack-security-group-cidr.png?​700 }} {{ :​scgc:​laboratoare:​openstack-security-group-cidr.png?​700 }}
-==== 6[10p] Delete the virtual machine ====+</​hidden>​ 
 +==== 5. Delete the virtual machine ====
 After each lab, and whenever you no longer need a virtual machine, please delete it. Go to the Horizon dashboard, go to ''​Project''​ > ''​Compute''​ > ''​Instances''​ and delete the virtual machine. You can either select all virtual machines your wish to delete from their checkbox on the left, and then click on ''​Delete Instances'',​ or select ''​Delete instance''​ from the dropdown menu on the right. After each lab, and whenever you no longer need a virtual machine, please delete it. Go to the Horizon dashboard, go to ''​Project''​ > ''​Compute''​ > ''​Instances''​ and delete the virtual machine. You can either select all virtual machines your wish to delete from their checkbox on the left, and then click on ''​Delete Instances'',​ or select ''​Delete instance''​ from the dropdown menu on the right.
  
 It would also be a good idea to delete the security group rule you have previously created earlier if you do not need to allow communication with machines outside your project. It would also be a good idea to delete the security group rule you have previously created earlier if you do not need to allow communication with machines outside your project.
scgc/laboratoare/00.1634131035.txt.gz · Last modified: 2021/10/13 16:17 by maria.mihailescu
CC Attribution-Share Alike 3.0 Unported
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0