User Tools

Site Tools


virtual_machines

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
virtual_machines [2019/12/09 19:47]
pwolinsk
virtual_machines [2020/05/22 18:08] (current)
pwolinsk
Line 93: Line 93:
 A special job queue named **cloud72** has been set up on Pinnacle to run all user VM jobs.  The name of the VM to be started has to be specified in the name of the job script. ​ The VM is started in the job prolog and destroyed in the job epilog. ​ A special job queue named **cloud72** has been set up on Pinnacle to run all user VM jobs.  The name of the VM to be started has to be specified in the name of the job script. ​ The VM is started in the job prolog and destroyed in the job epilog. ​
  
-You can start the VM by starting ​an interactive ​job on a node in **cloud72** queue. ​ In this example we are using 4 cores for the VM and specifying 1 hour run time:+You can start the VM by starting ​job on a node in **cloud72** queue.  Because the actual job launch command has multiple flags, we created a script **vm-job-lauch.sh** which takes 3 arguments: <​vm_name>​ <​number_of_cores>​ and <​number_of_hours>​.  In this example we are using 4 cores for the VM and specifying 1 hour run time:
  
 <​code>​ <​code>​
-pinnacle-l1:​pwolinsk:​~$ ​srun -N1 --tasks-per-node=4 -p cloud72 -t 1:00:00 -J ubuntu-18.04-pwolinsk --pty vm-bootup-info.sh +pinnacle-l1:​pwolinsk:​~$ vm-job-launch.sh ubuntu-18.04-pwolinsk ​4 1 
-Waiting for startup log (/​scrfs/​storage/​pwolinsk/​home/​cloud-12350.log)...found. +Submitting job to the queue with command:
-Waiting for VM to finish booting.Success +
-*********************************************************** +
- You are running an interactive bash session on c1329     +
- which is the host for your VM (ubuntu-18.04-pwolinsk).      +
- Terminating this bash session will stop the VM.       +
- It can be restarted at any time using this command ​  ​+
  
- ​srun ​-p cloud72 -t 1:00:00 -J ubuntu-18.04-pwolinsk ​-c cloud --pty vm-bootup-info.sh+   ​sbatch -N1 -n4 -p cloud72 ​-C cloud -t 1:00:00 -J ubuntu-18.04-pwolinsk ​waitforvm.sh ubuntu-18.04-pwolinsk
  
-ubuntu-18.04-pwolinsk is Ready. "ssh ubuntu@172.16.254.127" password: ubuntu +Submitted batch job 91063 
-*********************************************************** +Found job #91063 
-c1329:​pwolinsk:​~$ ​+Waiting for log file /​scrfs/​storage/​pwolinsk/​home/​cloud-91063.log ................ 
 + 
 +--------/​scrfs/​storage/​pwolinsk/​home/​cloud-91063.log----------------------------------------- 
 +Starting ubuntu-18.04-pwolinsk for pwolinsk 
 +Redirecting console output to /​scrfs/​storage/​pwolinsk/​home/​console-91063.log. 
 +Domain ubuntu-18.04-pwolinsk created from /​scrfs/​storage/​pwolinsk/​home/​vmdef-91063.xml 
 + 
 + 
 +ubuntu-18.04-pwolinsk booting up.......IP assigned 172.16.254.149 ... Waiting for SSH access ...done. 
 + 
 +ubuntu-18.04-pwolinsk is Ready. "ssh ubuntu@172.16.254.149" password: ubuntu 
 +Starting waitforvm script on host c1331 
 +pinnacle-l1:​pwolinsk:​~$
 </​code>​ </​code>​
  
Line 115: Line 121:
  
 <​code>​ <​code>​
-c1329:​pwolinsk:​~$ ssh ubuntu@172.16.254.127 + 
-Warning: Permanently added '​172.16.254.127' (ECDSA) to the list of known hosts. +pinnacle-l1:​pwolinsk:​~$ ssh ubuntu@172.16.254.149 
-ubuntu@172.16.254.127's password: ​+Warning: Permanently added '​172.16.254.149' (ECDSA) to the list of known hosts. 
 +ubuntu@172.16.254.149's password: ​
 Welcome to Ubuntu 18.04.3 LTS (GNU/Linux 4.15.0-48-generic x86_64) Welcome to Ubuntu 18.04.3 LTS (GNU/Linux 4.15.0-48-generic x86_64)
  
Line 123: Line 130:
  * Management: ​    ​https://​landscape.canonical.com  * Management: ​    ​https://​landscape.canonical.com
  * Support: ​       https://​ubuntu.com/​advantage  * Support: ​       https://​ubuntu.com/​advantage
 +
 +Failed to connect to https://​changelogs.ubuntu.com/​meta-release-lts. Check your Internet connection or proxy settings
  
 Last login: Wed Oct  2 14:58:31 2019 Last login: Wed Oct  2 14:58:31 2019
-ubuntu@vm-ubuntu-18:​~$  +ubuntu@vm-ubuntu-18:​~$ ​sudo /bin/bash 
-ubuntu@vm-ubuntu-18:​~cat /​proc/​cpuinfo ​ |grep processor+[sudo] password for ubuntu:  
 +root@vm-ubuntu-18:​~cat /​proc/​cpuinfo |grep processor
 processor : 0 processor : 0
 processor : 1 processor : 1
 processor : 2 processor : 2
 processor : 3 processor : 3
-ubuntu@vm-ubuntu-18:​~$  +root@vm-ubuntu-18:​~
 </​code>​ </​code>​
  
 === Stopping the VM === === Stopping the VM ===
 +The **vm-job-launch.sh** will continue to monitor the VM state. ​ When it detects that the VM has been shut down, the job is automatically terminated. ​ So simply logging out of the VM will not end the VM job.  It will continue to run until the walltime of the job expires. ​
  
-Ending the interactive session on the cloud72 compute node (c1329 in this example), will stop the job and the job epilog script will destroy (stop) the VM. 
  
 <​code>​ <​code>​
 +root@vm-ubuntu-18:​~#​ exit
 +exit
 ubuntu@vm-ubuntu-18:​~$ exit ubuntu@vm-ubuntu-18:​~$ exit
 logout logout
-Connection to 172.16.254.127 closed. +Connection to 172.16.254.149 closed. 
-c1329:​pwolinsk:​~$ ​exit +pinnacle-l1:​pwolinsk:​~$  
-exit+ 
 +pinnacle-l1:​pwolinsk:​~$ vm-list.sh  
 + 
 +pwolinsk'​s VMS (Pinnacle Cluster) ​          ​STATE ​      VM IP              HOST  
 +================================================================================ 
 +centos6.10-pwolinsk ​                        SHUT OFF    
 +centos7.6-desktop-pwolinsk-1 ​               SHUT OFF    
 +centos7.6-lustre-pwolinsk ​                  SHUT OFF    
 +centos7.6-pwolinsk ​                         SHUT OFF    
 +centos7.6-pwolinsk-1 ​                       SHUT OFF    
 +centos7.6-pwolinsk-2 ​                       SHUT OFF    
 +library-pwolinsk ​                           SHUT OFF    
 +pqs-devel ​                                  SHUT OFF    
 +ubuntu-18.04-desktop-pwolinsk ​              SHUT OFF    
 +ubuntu-18.04-pwolinsk ​                      ​RUNNING ​   172.16.254.149 ​     c1331  (52:​54:​00:​59:​ae:​74) 
 + 
 +Virtual machines are stored in /​storage/​pwolinsk/​.virtual-machines. 
 +Total storage on disk: 42G total 
 + 
 +pinnacle-l1:​pwolinsk:​~$ squeue -u pwolinsk 
 +             JOBID PARTITION ​    ​NAME ​    USER ST       ​TIME ​ NODES NODELIST(REASON) 
 +             ​91063 ​  ​cloud72 ubuntu-1 pwolinsk ​ R      10:19      1 c1331 
 +pinnacle-l1:​pwolinsk:​~$ ​
 </​code> ​ </​code> ​
  
-The **cloud72** queue has a limit of 72 hoursso VM jobs are treated just like any other job in the queue. ​ They cannot run indefinitely.  ​+To end the job before the job walltime ​limit, ​simply log into the VM and shut it down:
  
 +<​code>​
 +pinnacle-l1:​pwolinsk:​~$ ssh ubuntu@172.16.254.149
 +ubuntu@172.16.254.149'​s password: ​
 +Welcome to Ubuntu 18.04.3 LTS (GNU/Linux 4.15.0-48-generic x86_64)
 +
 + * Documentation: ​ https://​help.ubuntu.com
 + * Management: ​    ​https://​landscape.canonical.com
 + * Support: ​       https://​ubuntu.com/​advantage
 +
 +Failed to connect to https://​changelogs.ubuntu.com/​meta-release-lts. Check your Internet connection or proxy settings
 +
 +Last login: Fri May 22 09:37:50 2020 from 172.16.16.51
 +ubuntu@vm-ubuntu-18:​~$ sudo /bin/bash
 +[sudo] password for ubuntu: ​
 +root@vm-ubuntu-18:​~#​ shutdown -h now
 +Connection to 172.16.254.149 closed by remote host.
 +Connection to 172.16.254.149 closed.
 +pinnacle-l1:​pwolinsk:​~$ vm-list.sh ​
 +
 +pwolinsk'​s VMS (Pinnacle Cluster) ​          ​STATE ​      VM IP              HOST 
 +================================================================================
 +centos6.10-pwolinsk ​                        SHUT OFF   
 +centos7.6-desktop-pwolinsk-1 ​               SHUT OFF   
 +centos7.6-lustre-pwolinsk ​                  SHUT OFF   
 +centos7.6-pwolinsk ​                         SHUT OFF   
 +centos7.6-pwolinsk-1 ​                       SHUT OFF   
 +centos7.6-pwolinsk-2 ​                       SHUT OFF   
 +library-pwolinsk ​                           SHUT OFF   
 +pqs-devel ​                                  SHUT OFF   
 +ubuntu-18.04-desktop-pwolinsk ​              SHUT OFF   
 +ubuntu-18.04-pwolinsk ​                      SHUT OFF   
 +
 +Virtual machines are stored in /​storage/​pwolinsk/​.virtual-machines.
 +Total storage on disk: 42G total
 +
 +pinnacle-l1:​pwolinsk:​~$ squeue -u pwolinsk
 +             JOBID PARTITION ​    ​NAME ​    USER ST       ​TIME ​ NODES NODELIST(REASON)
 +pinnacle-l1:​pwolinsk:​~$ ​
 +</​code>​
  
 +The job is terminated as soon as the VM stops. ​ The **cloud72** queue has a limit of 72 hours, so VM jobs are treated just like any other job in the queue. ​ They cannot run indefinitely.  ​
virtual_machines.1575920822.txt.gz · Last modified: 2019/12/09 19:47 by pwolinsk