KVM and VirtualBox Images of XtreemOS this tutorial briefly explains how to run three XtreemOS images. You may choose if you want to use either KVM or VirtualBox.
Getting images
The images from INRIA can be downloaded from https://transfert.inria.fr.
KVM
KVM: Get virtual machine images
Links for downloading 2.1.2 XOS images, their checksums and their virsh configuration files:
- Core node
- Core node image checksum: MD5(xos-core.img)= 8099c3fb3370bbaf940104d6a6bc2221
- Core node configuration
- Resource node1 image
- Resource node1 image checksum: MD5(xos-node1.img)= 92f1c4e59a1cb6e7539402498193524c
- Resource node1 configuration
- Resource node2 image
- Resource node2 image checksum: MD5(xos-node2.img)= 79d6e10b06e27a08db0402564dc869b5
- Resource node2 configuration
The 3 images have been built using 2.1.2-x86_64 iso.
The image files are of type qcow2 (using raw format ends with file-system corruption on my Ubuntu 9.10).
You need to install at least the xos-core image as it supports all core services of XtreemOS.
KVM: Configure the network
For these images, the default KVM network is configured as follow (file /var/lib/libvirt/network/default.xml on my ubuntu):
<network>
<name>default</name>
<uuid>f7c4b917-29ae-7614-1a3e-8c542f5c7205</uuid>
<forward mode='nat'/>
<bridge name='virbr0' stp='on' forwardDelay='0' />
<ip address='192.168.122.1' netmask='255.255.255.0'>
<dhcp>
<range start='192.168.122.2' end='192.168.122.254' />
<host mac='54:52:00:00:10:00' ip='192.168.122.10' />
<host mac='54:52:00:00:10:01' ip='192.168.122.11' />
<host mac='54:52:00:00:10:02' ip='192.168.122.12' />
<host mac='54:52:00:00:10:03' ip='192.168.122.13' />
<host mac='54:52:00:00:10:04' ip='192.168.122.14' />
<host mac='54:52:00:00:10:05' ip='192.168.122.15' />
</dhcp>
</ip>
</network>
<name>default</name>
<uuid>f7c4b917-29ae-7614-1a3e-8c542f5c7205</uuid>
<forward mode='nat'/>
<bridge name='virbr0' stp='on' forwardDelay='0' />
<ip address='192.168.122.1' netmask='255.255.255.0'>
<dhcp>
<range start='192.168.122.2' end='192.168.122.254' />
<host mac='54:52:00:00:10:00' ip='192.168.122.10' />
<host mac='54:52:00:00:10:01' ip='192.168.122.11' />
<host mac='54:52:00:00:10:02' ip='192.168.122.12' />
<host mac='54:52:00:00:10:03' ip='192.168.122.13' />
<host mac='54:52:00:00:10:04' ip='192.168.122.14' />
<host mac='54:52:00:00:10:05' ip='192.168.122.15' />
</dhcp>
</ip>
</network>
Using this configuration, KVM provides IP addresses and network configuration through DHCP. KVM also forwards access to DNS through the guest, extended with the guest /etc/hosts file.
So, you should add the following lines to the guest /etc/hosts file.
192.168.122.10 xos-core.xtreemos.eu xos-core
192.168.122.11 xos-node1.xtreemos.eu xos-node1
192.168.122.12 xos-node2.xtreemos.eu xos-node2
192.168.122.13 xos-node3.xtreemos.eu xos-node3
192.168.122.11 xos-node1.xtreemos.eu xos-node1
192.168.122.12 xos-node2.xtreemos.eu xos-node2
192.168.122.13 xos-node3.xtreemos.eu xos-node3
KVM: Extract the images
Extract the images (it will take about 10min):
bunzip2 xos-core.img.bz2
bunzip2 xos-node1.img.bz2
bunzip2 xos-node1.img.bz2
Beware that the decompressed img files can be quite big (10+GB). However, these files are sparse so you can save lots of disk space using the following commands instead:
bzcat -k xos-core.img.bz2 | cp --sparse=always /dev/stdin xos-core.img
bzcat -k xos-node1.img.bz2 | cp --sparse=always /dev/stdin xos-node1.img
bzcat -k xos-node1.img.bz2 | cp --sparse=always /dev/stdin xos-node1.img
KVM: Configure the virtual machines
Then edit xos-core.xml and xos-node1.xml: provide correct pathname for xos-core.img and xos-node1.img.
You must enter the image localizations in their XML files — in the <disk> tag. For example, by replacing this path /VM/xos-node1.img' by the right path.
<disk type='file' device='disk'>
<source file='/VM/xos-node1.img'/>
<target dev='hda' bus='ide'/>
</disk>
<source file='/VM/xos-node1.img'/>
<target dev='hda' bus='ide'/>
</disk>
KVM: Start the core node
The following command should start the core node.
sudo virsh create xos-core.xml
Alternative:
sudo virsh define xos-core.xml
sudo virsh start xos-core
sudo virsh start xos-core
Please check the virsh documentations if necessary. Note that it also possible to manage virtual machines using the virt-manager GUI.
KVM: Preconfigured users
Unix accounts: xuser and root- All passwords are xtreemos
IMPORTANT: The machines was configured with an AZERTY keyboard. Try to take it into account when typing the password, then run "setxkbmap us" once logged in to switch to a QWERTY one.
KVM: Log in the xos-core
As you have already started the xos-core, you can log in through a normal (non virtual) terminal as follows. Remember that xuser's password is xtreemos.
$ ssh
yjegou@paralombre:~$ ssh
Last login: Fri Jun 11 11:53:29 2010 from 192.168.122.1
xuser@xos-core ~$
yjegou@paralombre:~$ ssh
Last login: Fri Jun 11 11:53:29 2010 from 192.168.122.1
xuser@xos-core ~$
You can also use the core node host name if it has been entered in the guest /etc/hosts file.
yjegou@paralombre:~$ ssh xuser@xos-core
Last login: Thu May 27 11:24:03 2010 from 192.168.122.1
xuser@xos-core ~$
Last login: Thu May 27 11:24:03 2010 from 192.168.122.1
xuser@xos-core ~$
Same procedures for other nodes. Note that the configuration of the VMs does not allow root to connect directly on the nodes using a password: the ssh key is mandatory. If you want to allow ditect connection for root, you should first transfer your ssh public key with scp using account xuser, connect as xuser, become root using su and install your ssh public key in /root/.ssh/authorized_keys2.
KVM: Re-configuration of nodes
These virtual machine are already configured using the xosautoconfig tool. However, if you modify some configuration parameters, the node IP addresses for instance, it is necessary to report these modifications XtreemOS configuration files. In the general case, running command xosautoconfig as root should automatically update these files. If you want to change the hostname and/or IP, you can either edit the /var/lib/libvirt/network/default.xml and /etc/hosts of the guest or provide a /etc/hosts file on all hosts. If you install this file in /etc/xos/xosautoconfig/conf/etc/hosts, xosautoconfig will automatically replicate it in /etc/hosts.
KVM: Problem with expired user certificate
The virtual machines come with already installed service and user certificates. As the validy of user certificates is 1 month by default, those installed in the images might be obsolete. If you have one of the following errors when you run xps, you need to regenerate the user certificate.
root@xos-core ~# xps -a
xps: Error getting user jobs: -1 (Generic exception)
certificate expired on 20100527115829GMT+00:00
root@xos-core ~#
xps: Error getting user jobs: -1 (Generic exception)
certificate expired on 20100527115829GMT+00:00
root@xos-core ~#
root@xos-node1 ~# xps -a
xps: Error getting user jobs: -1 (Generic exception)
NotAfter: Thu May 27 13:58:29 CEST 2010
root@xos-node1 ~#
xps: Error getting user jobs: -1 (Generic exception)
NotAfter: Thu May 27 13:58:29 CEST 2010
root@xos-node1 ~#
Use the following request to renew the certificate:
root@xos-core ~# mv /root/.xos/truststore/certs/xuser.crt /root/.xos/truststore/certs/xuser-prev.crt
root@xos-core ~# get-xos-cert xos-core:6730 vo-xuser users -u xuser -P xtreemos -K /root/.xos/truststore/private/xuser.key -k /root/.xos/truststore/private/xuser.key-new.key -c /root/.xos/truststore/certs/xuser.crt
Enter user password:
Warning: certificate presented by remote host xos-core belongs to xos-core.xtreemos.eu -
carrying on as you requested to ignore CDA host certificates which don't belong to the CDA server you connected to.
You should only use any credentials issued for testing purposes.
Saving certificate chain (user+CDA) in /root/.xos/truststore/certs/xuser-new.crt.
root@xos-core ~#
root@xos-core ~# get-xos-cert xos-core:6730 vo-xuser users -u xuser -P xtreemos -K /root/.xos/truststore/private/xuser.key -k /root/.xos/truststore/private/xuser.key-new.key -c /root/.xos/truststore/certs/xuser.crt
Enter user password:
Warning: certificate presented by remote host xos-core belongs to xos-core.xtreemos.eu -
carrying on as you requested to ignore CDA host certificates which don't belong to the CDA server you connected to.
You should only use any credentials issued for testing purposes.
Saving certificate chain (user+CDA) in /root/.xos/truststore/certs/xuser-new.crt.
root@xos-core ~#
(note that it seems necessary to provide the -k option to get-xos-cert also no new key is generated)
VitrualBox
The VirtualBox? VM's were created on VirtualBox? 3.2.10. There is an incompatibility with some older versions. If you experience some problems to start machines, you can download the appropriate version from here http://virtualbox.org
The images can be downloaded as follows:
- https://transfert.inria.fr/fichiers/eb09d9633fbe02f4399b7c93344622f8/testbed1-xos-core.tgz
- (MD5=313b9249740b2c5c0f5655b08bf1cd66)
- https://transfert.inria.fr/fichiers/846ac0d46c710e731267e2cc7a297617/testbed1-xos-node1.tgz
- (MD5=23a6007683f13109020d296ff82ec52a)
- https://transfert.inria.fr/fichiers/8cf55fb758e2f877ba08eec227879d35/testbed1-xos-node2.tgz
- (MD5=8325df07059de0d3f6e16b773496dd3f)
After extracting them (#tar zxf {target}), you will find,for each machine, two files (.vmdk and .ovf) to be imported in VirtualBox?.
Installation
Once Imported, I recommend giving the VM 512Mb or more of ram for the resource
node and 768Mb of ram for the coreservices node.
VirtualBox? may fail to run the image if hardware virtualization (VT-x/AMD-V under system/acceleration) is not selected.
On some systems VT-x/AMD-V also has to be enabled in the BIOS for it to work.
Configuration
The core node can be used alone: it is also a resource node.
For the resource node installation, use the same procedure.
Network
The network configuration of the images are static and use private IP addresses:192.168.56.101 xos-core.xtreemos.eu
192.168.56.102 xos-node1.xtreemos.eu
192.168.56.103 xos-node2.xtreemos.eu
These nodes are configured using host only networking, thus if you need to access the internet, it is best to enable eth1 (the second network card) in VirtualBox? as NAT interface, run the internet tasks and then ifdown eth1, before running XtreemOS jobs. Don't forget to disable eth1 when the machine is restarted.
Preconfigured users
Unix account: xuser- All passwords are xtreemos
IMPORTANT: The machines was configured with an AZERTY keyboard. Try to take it into account when typing the password, then run "setxkbmap us" once logged in to switch to a QWERTY one.
Known problems
Sometime, it seems that the dixi of the resource node is not connected to the core node. grep ERR /var/log/xosd/xosd to check that everything is OK. If not, restart xosd.Note: Installing virsh
Let's use the virsh to help us when managing images. To install virsh in Debian-based distributions, you should just install the libvirt-bin package. As follows, we do it by using aptitude:
aptitude install libvirt-bin
Configuring virsh (libvirt)
In our case, we use NAT forwarding (aka virtual networks). So follow this page
If you have a problem as the following one:
$ sudo virsh net-start default
Connecting to uri: qemu:///system
error: Failed to start network default
error: internal error 'dnsmasqstrict-order bind-interfaces pid-file=/var/run/libvirt/network/default.pid conf-file= listen-address 192.168.122.1 except-interface lo --dhcp-range 192.168.122.2,192.168.122.254' exited with non-zero status 2 and signal 0:
dnsmasq: failed to bind listening socket for 192.168.122.1: Address already in use
Connecting to uri: qemu:///system
error: Failed to start network default
error: internal error 'dnsmasq
dnsmasq: failed to bind listening socket for 192.168.122.1: Address already in use
...sttoping dnsmasq should solve it:
/etc/init.d/dnsmasq stop
Now, let's run the virsh terminal:
$ sudo virsh
Connecting to uri: qemu:///system
Welcome to virsh, the virtualization interactive terminal.
Type: 'help' for help with commands
'quit' to quit
virsh #
Connecting to uri: qemu:///system
Welcome to virsh, the virtualization interactive terminal.
Type: 'help' for help with commands
'quit' to quit
virsh #
So, you can play with virsh commands. For example, listing the virtual machines:
virsh # list
Id Name State
----------
7 xos-core running
Id Name State
7 xos-core running
Support
Do not hesitate to join us on IRC #xtreemos-dev on irc.freenode.net if you
need help.
Good luck.
