MetaCloud management via web interface
THIS PART OF WIKI IS OUTDATED AND UNDER CONSTRUCTION. PLEASE BE PATIENT.
Starting the virtual machine
All the available templates and images can be found under the Virtual Resources -> Templates or Images sections in the left menu. When in Templates section you can choose one of the templates and initiate a virtual machine by clicking on the Initiate button in the top right menu. List of your running virtual machines can be found undre the Virtual Machines section.You should pay attention to the Status column where you can see the current virtual machine's state. There is also a VM's IP(s) column which contains an VM's address for ssh connection.
Metacloud management
VM templates management
List of the available templates can be found Virtual Resources -> Templates section in the left menu. When in Templates section you can choose one of the templates and initiate a virtual machine by clicking on the Initiate button in the top right menu. Clic on the template name to see its information and click on the Template button to see aditional information.
New template creation
You can also create your own template file. Seek the 'Virtual Resources -> Templates' tab (1.) and click on '+New' button (2.). 'Create VM template' window will pop up. Switch to 'Wizard XEN' tab (3.). Now just fill in following parameters and the template file will be ready.
- Capacity options
- Name - name of the template, that will be shown in templates list
- Memory - memory size of virtual machine in MB (eg. 512, current memory maximum for VM is exactly 94647MB)
- CPU - number of VM's VCPUs you plan to use (it is possible set half a CPU ie. 0.5, but if you plan CPU demandig computations, please, set it to same number as VCPU)
- VCPU - number of virtual CPUs (if not set, default settings will be used)
- Boot/OS options
- Architecture - CPU architecture
- Boot method - boot method, choose bootloader
- Bootloader - set to pygrub
- Add disks/images
- Image - choose wanted image from options, eg. debian6
- Target - device name undre the system
- Driver - disk driver for XEN
- after setting up all the parameters, click on the 'Add' button and disk will be added to 'Current disks' list
- Setup Networks
- Network - from given options choose the network named 'public'
- IP - leave out blank (there is no need of special IP address)
- Firewall setup is described below.
- Click on the 'Add' button, and in the 'Current NICs' list should appear a network with ID 1.
- Add context variables
- Set up this parameter only if you want the VM to be contextualized.
- Sequentially enter pairs 'Name' and 'Value' and confirm each by clicking the 'Add' button. The pair will show up in 'Current variables' list.
- example:
Name - ssh_key Value - ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDUhViIU1WmVFnQ THwgAYg+u5lglCZb5nhJvdlFoNoKCdxxTcCEnLDhWH+lgK1vK5N1RL0wEIdgB 7YHnXcc5WHSBRrQ2BWhUI+vMDa0RDs3hXWp9NwBtHYSUj2P73bp+Zq4QPTYRW ISjJvWXKRjM9fqx24ffrTWtWSiDjyWexe9ZygNkc6UIuOolNgGrg90TzHILtD 2UINqAUQXEs2sxx1Yi88MFNRSDvcjyzRQv/2BTBsFXIwScuI6cOn9Gp0pxpVi wiUSIaZBcJBzF2SpUf4SAKNn9q53/Q2R6SphWUzKuEDIxmDrZkwKiqqMjq1aa JPb2FzVTnTbF4xgGNQH+Hjf login@host
Name - files Value - http://is.muni.cz/www/256254/init.sh
init.sh is sample contextualization script, which however must be supported by VM. Contextualization is optional.
Name - hostname Value - DebianVM
Remaining options are optional as well so you can leave default values in there. By clicking the 'Create' button the template will be created and it will be shown in the list.
Modifying a template
Instead of creating a new template you can also copy one of teh prepared templates and modify it according to you. In Template section choose the template you want to cop and click on the Clone button in the top right menu. In clone dialog fill the template name and click Clone. You can modify your new template by clicking on teh Update properties button in the top right menu. To change the system disk (how to save a system disk is described in section Disk management) in a template you should update these settings:
DISK=[ DEV_PREFIX="vd", IMAGE="name of saved image", IMAGE_UNAME="your user name" ]
VM images management
List of available images can be found undre the Virtual Resources -> Images section. You can upload your own images to MetaCloud or copy one of the available images. Choose the image and click on the Clone button in the top right menu. Choose the image name and click Clone. You can change the persistence of your image by clicking on the Persistent column of your image. Data stored on persistent image won't be deleted after the shutdown and you can initiate only one VM with persistent image. On the other hand non-persistent image won't store data aftre the shutdown but you can initiate more then one VMs with this image. For better understanding see Cloud workflow example.
VM management
To manage VMs via Sunstone interface you have to switch to 'Virtual Machines' tab (1.) first. There you can see the list of running VMs, that are visible for you. For more information about particular VM, you just have to click on it in the list (2.) and in the bottom part of the screen (3.) the information will show divided into several tabs:
- VM information
- Disks & Hotplugging - disk management, discribed below
- VM template - detailed info about the template file, including the IP address generated by OpenNebula
- VM log
- History information
- Monitoring information
More actions can be done after selecting VM (4.). After that the select box (6.) will be available with these options:
- Hold - Switch the status of VM from PENDING to HOLD.
- Release - Release the VM from HOLD status.
- Terminate - Switch the selected VMs to SUSPENDED status.
- Resume - Resume VMs from the STOPPED or SUSPENDED status.
- Stop - Stops selected VMs.
- Restart - Restarts selected VMs in the UNKNOWN or BOOT status.
- Resubmit - Resubmits selected VMs in the PENDING status.
- Save as - OpenNebula usually does not save current state of VM after shutdown, therefore if you want to save the changes made in VM you have to do so with this action before using 'Shutdown' (6.). New image will be saved and new template has to be created, because the ID of the image will be different.
Note: after using 'Save as' it is important to turn the VM off with 'Shutdown'. Turning off the VM by using 'Cancel' or 'Delete' will cancel the 'Save as' action. - Cancel - Cancels selected VMs
The complete list of possible VMs' states (described in detail in documentation)
*Pending (pend): Waiting for resources and deployment. *Hold (hold): The owner has held the VM and it will not be scheduled until it is released. It can be, however, deployed manually. *Prolog (prol): The system is transferring the VM files (disk images and the recovery file) to the host in which the virtual machine will be running. *Running (runn): The VM is running. In this state, the virtualization driver will periodically monitor it. *Migrate (migr): The VM is migrating from one resource to another. *Epilog (epil): In this phase the system cleans up the Host used to virtualize the VM, and additionally disk images to be saved are copied back to the front-end. *Stopped (stop): The VM is stopped. VM state has been saved and it has been transferred back along with the disk images to the front-end. *Suspended (susp): Same as stopped, but the files are left in the host to later restart the VM there. *Failed (fail): The VM failed. *Unknown (unknown): The VM couldn't be reached, it is in an unknown state. *Done (done): The VM is done. VMs in this state won't be shown with “onevm list” but are kept in the database for accounting purposes.
Firewall
Warning: Users are responsible for the security of their virtual machines. Please pay attention to correct firewall setup. Set your security groups before instantiating VMs.
Firewall functions are set up through the use of Security Groups. Individual security groups carry listings of ports to be kept open. Simply put, the more security groups, the more open a VM is. The default security group all MetaCloud VMs are members of allows only ports TCP 22 (SSH), TCP 3389 (RDP) and several ranges of UDP ports to enable DHCP and similar protocols.
Te use of security groups in MetaCloud is expplained in greater detail in a separate document.
Virtual machines are assigned to security groups based on settings in their templates. The procedure is documented in OpenNebula Documentation.
Disk management
Disks in virtual machines can be attached or detached while the VM is still running (hotplugging). You cannot attach the system disks, only the data disks. To change the system disk in a VM you should modify a template of an existing machine.
In 'Virtual Machines' tab (1.) select the virtual machine, in which you want to add or remove the disk (2.) and switch to the 'Disks & Hotplugging' tab (3.).
To remove the disk just click the 'Detach X' button (4.) next to the selected disk.
There are two options how to attach a disk to VM:
- If you have a prepared image select 'Type: Existing image' and select your image in 'Select image:' menu. 'Device prefix:' should be vd and then just click the 'Attach' button (5.).
- Otherwise select 'Type: Volatile disk', enter size of the disk, its format e.g. ext3 and 'Type:' fs (file system) or swap. 'Device prefix:' should be vd and then just click the 'Attach' button (5.).
The disk in VM will show up in /dev as DEVICE_PREFIX + {c, d, e, ...}. Suffix letter is generated alphabetically used as first free letter!
It is recommended to not change /etc/fstab! Rather modify template for stable disk connection.
Do not use /dev/vdb as connection point as in template as in /etc/fstab! This drive is reserved for contextualization and VM will be unbootable otherwise!