Escolar Documentos
Profissional Documentos
Cultura Documentos
10
This documentation is brought to you by openQRM Enterprise
http://www.openqrm-enterprise.com
Document Version : 27.10.2010 openQRM Enterprise GmbH Berrenrather Strae 188c 50937 Kln / Germany Telefon : +49 (0) 221 995589-10 Fax : +49 (0) 221 995589-20 Mail : info@openqrm-enterprise.com
Table of Contents
The perfect server: openQRM, UEC and EC2 on Ubuntu 10.10 ..............................................................1 Hybrid Cloud Computing with openQRM.................................................................................................2 Requirements.........................................................................................................................................2 Install the system with Ubuntu 10.10 (64bit) as a "Node Controller" ..................................................2 Install openQRM from the source repository........................................................................................3 Install the Ubuntu Enterprise Cloud Controller in a KVM VM............................................................8 Configure the Ubuntu Enterprise Cloud .............................................................................................43 Import an AMI from the Ubuntu Enterprise Cloud (or Amazon EC2) ..............................................50 Run the imported AMI on a local KVM VM .....................................................................................64 Export an openQRM Image to Amazon EC2 .....................................................................................76 Thanks.................................................................................................................................................83 Urls......................................................................................................................................................83
The goal of this HowTo is to have a single system setup with the Ubuntu Enterprise Cloud (UEC) and the openQRM Cloud. This system will allow to migrate services from the UEC and Amazon EC2 to the openQRM Cloud and from openQRM Cloud to UEC and Amazon EC2.
Requirements
- 1 64bit system having the VT (Virtualization Technology) CPU extension - 2 GB RAM (or more) - 200 GB disk space (or more)
After the installation finished reboot into the fresh Ubuntu 10.10 system. Now create a iso image from the Ubuntu 10.10 CD. Insert the CD, open a terminal and run : sudo bash mkdir /isos dd if=/dev/cdrom of=/isos/ubuntu-10.10.iso
Now we are going to enable the required openQRM plugins for this HowTo. Enable and start the following plugins : kvm, kvm-storage, lvm-storage, hybrid-cloud, tftpd Just enable the "dhcpd" plugin. Do not start it (yet) !
We are mpw going to install the Ubuntu Enterprise Cloud Controller within a virtual machine managed by openQRM. The virtual-machine type for the UEC CC will be "kvm-storage".
Now we are going to prepare the volume to install the UEC CC on. Goto Base -> Components -> Storage -> New Storage
Create a new kvm-storage server (type KVM LVM Storage) using the openQRM system as the resource
Provide a name for the kvm-storage server, here we will use "kvmstorageserver"
Goto Base -> Components -> Storage and click on "Mgmt" of the kvm-storage Select the "lvols" volume group
Create a new volume for the UEC "Cloud Controller" on the kvm-storage server. Name it "ubuntucc" and give it at least 40GB volume size.
Goto Base -> Components -> Image -> New Image Select the kvm-storage server "kvmstorageserver"
Povide a name for the "image" object, here we will use "ubuntucc"
Here the Image list after we have created the Image object.
Now we are going to prepare the VM resource for the UEC CC.
Create the kvm-storage Hosts Goto Base -> Appliance -> Create and create a new kvm-storage Host appliance using the openQRM system as the resource
Create a new kvm-storage VM: Goto Plugins -> Virtualization -> kvm-storage -> VM-Manager Select the kvm-storage Host
Provide a name for the VM, here we will use "kvmstoragevm1" Set the VMs memory to at least 1024 MB Select "iso image" as the boot-medium and fill in the path to the ubuntu-10.10.iso /isos/ubuntu-10.10.iso
Creating the VM will reserve the VMs components and create a new, idle resource.
Now we will put the "image" and the "resource" we have created together via an "appliance". Goto Base -> Appliance -> Create Select the new created "idle" resource (the kvm-storage VM)
Provide a Name for the appliance, here we will use "ubuntucc" Leave the default kernel Select the "ubuntucc" image Select the resource type "KVM-Storage VM"
The idle resouce will now boot into the Ubuntu installation accessible via VNC . Install vncviewer : sudo bash apt-get install xtightvncviewer
You can access the Install screen via "vncviewer" on the openQRM Server. vncviewer 192.168.88.100:50
Hints For kvm-storage VMs the first VNC id will be 50 If you are logged in via ssh you need to have X-forwarding enabled e.g. ssh -X openqrm A remote VM console integrated into openQRM is available from openQRM Enterprise http://www.openqrm-enterprise.com
For the Ubuntu Enterprise Cloud Controller installation follow the steps below : Select "Install Ubuntu Enterprise Cloud"
Manually configure the network device. Set a static ip-address in this HowTo it will be 192.168.88.101, hostname ubuntucc)
Later in the installation setup the ip-addresses to be used by UEC In this Howto this will be 192.168.88.102-192.168.88.122
Rebot after the installation of the Ubuntu Enterprise Cloud Controller. Please notice : The VM will now still try to boot from the CD and fail ! This is because the VM is still configured to boot from the iso image. Please see the next part how to re-configure the VM to boot from local disk.
Before we will boot the now ready installed Ubuntu Enterprise Cloud Controller we will create a snapshot of its disk. Then we will re-configure the "ubuntucc" appliance to use the snapshot instead of the origing volume. This enables you to roll-back at any time in case you need a fresh Cloud Controller. Here how to create the snapshot : Goto Base -> Appliance and stop the ubuntucc appliance
Goto Base -> Components -> Storage and click on "Mgmt" of the kvm-storage Select the "lvols" volume group Fill in a snapshot name (here "ccsnapshot1" and provide a size, here 20GB). Click on "snap"
Now we have to create a new Image from the snapshot volume: Goto Base -> Components -> Image -> New Image Select the kvm-storage server "kvmstorageserver" Povide a name for the new "image" object, here we will use "ccsnapshot1" and select the "ccsnapshot1" volume as the root-device
Goto Base -> Appliance and edit the ubuntucc appliance Adjust the Root-device to the ccsnapshot1 image and save
Now re-configure the VM to do a localboot : Goto Plugins -> Virtualization and stop the VM
When the VM is stopped click on "Config" In the config screen edit the boot-order
Goto Base -> Appliance and start the ubuntucc appliance again
You can now access the VM again via "vncviewer" on the openQRM Server. vncviewer 192.168.88.100:50 to check its boot-up from local disk.
Here how to install the credentials on your openQRM Server. Please open a terminal and run : mkdir .euca mv euca2-admin-x509.zip .euca/ cd .euca/ unzip euca2-admin-x509.zip . eucarc
After that you are able to use the UEC commandline tools e.g. euca-describe-availabilityzones Next step is to set the password for user "eucalyptus" on the openQRM server which is also a UEC Node Controller. sudo bash passwd eucalyptus
We need to have this in the following step on the UEC system itself to discover the Node Controller. Login to the UCE Cloud Controller (the VM at 192.168.88.101) and run : sudo euca_conf --discover-nodes This will automatically rsync the ssh-keys and add the Node Controller to the UEC cluster.
Now we go back to the UEC Admin UI and download one of the pre-made UEC Images. For this HowTo we selected the Ubuntu Karmic 10.04 64bit. Clicking on Download will download and install the image in the UEC Cloud.
Before we actually start an instance of this AMI we need to create a ssh keypair an open port 22 on the UEC firewall to enable ssh login. On the openQRM Server open a terminal and run : . .euca/eucarc euca-add-keypair mykey > ~/.euca/mykey.priv euca-authorize -P tcp -p 22 -s 0.0.0.0/0 default
Starting an instance on the UEC Cloud Now we are going to start an instance on the Ubuntu Enterprise Cloud via the euca-runinstances command. Open a terminal on the openQRM server and follow the steps below : . .euca/eucarc euca-run-instances -k mykey emi-DEBF106A -t m1.small Please notice that you need to get the AMI name (here emi-DEBF106A) from the image overview in UEC. After a short while the instances is running and we can login via ssh. ssh -i .euca/mykey.priv ubuntu@192.168.88.102
To prepare the Import of this AMI into openQRM we now need to adjust the /root/.ssh/authorized_keys file on the AMI. Simply cat the /home/ubuntu/.ssh/authorized_keys to /root/.ssh/authorized_keys to enable passwordless ssh login for the root user too.
Import an AMI from the Ubuntu Enterprise Cloud (or Amazon EC2)
First step to import from the Ubuntu Enterprise Cloud is to define the UEC credentials in openQRM. Goto Plugins -> Components -> Deployment -> Hybrid-Cloud -> Accounts Provide an Account name (you can choose any name) Set the path to the UEC rc-config file Set the path to the ssh-key file Set the type of the account
Second step for importing the AMI of the running instance is to create a volume on storage server in openQRM. Create a lvm-storage (NFS) server in openQRM Goto Base -> Components -> Storage -> New Storage Create a new lvm-storage server (type LVM Storage NFS) using the openQRM system as the resource
Provide a name for the lvm-storage server, here we will use "lvmstorageserver"
Here the Storage list in openQRM after we added the new storage
Goto Base -> Components -> Storage and click on "Mgmt" of the lvm-storage Select the "lvols" volume group
Create a new volume to import the AMI to. Name it "uecubuntuimport" and give it at least 2000MB volume size.
Now we have to create a new Image from the new empty volume: Goto Base -> Components -> Image -> New Image Select the lvm-storage server "lvmstorageserver"
Povide a name for the new "image" object, here we will use "uecubuntuimport" and select the "uecubuntuimport" volume as the root-device
Import the AMI Goto Plugins -> Deployment -> Hybrid-Cloud -> Import Select your UEC account
On the next screen select the Image to transfer the AMI to and click on "put"
openQRM will now import the AMI. You can check the Event list for the progress.
Please notice that you make sure to only have one dhcp-server running in your setup! Eiher have openQRM serving dhcp or the UEC Cloud Controller.
Now create a kvm Hosts: Goto Base -> Appliance -> Create and create a new kvm Host appliance using the openQRM system as the resource
Provide a name for the appliance, here we will use "kvmhost" Select "KVM Host" as the resource type
Create a new KVM VM: Goto Plugins -> Virtualization -> kvm -> VM-Manager, select the kvm Host
Creating the VM will reserve the VMs components and create a new, idle resource.
Now we will put the "image" (the imported AMI) and the "resource" we have created (the new KVM VM) together via an "appliance". Goto Base -> Appliance -> Create Select the new created "idle" resource (the idle kvm VM)
Provide a Name for the appliance, here we will use "uecubuntuimport" Leave the default kernel Select the "uecubuntuimport" image Select the resource type "KVM VM"
The idle resouce will now reboot and start the "uecubuntuimport" image. The VM is now accessible via VNC vncviewer 192.168.88.100:1 Hints - For kvm VMs the first VNC id will be 1
You can ssh to the running appliance in the same way as we did for the AMI. ssh -i .euca/mykey.priv root@192.168.88.253 Please get the ip of the appliance in the openQRM resource overview.
The imported AMI, now available in openQRM as an Image, can be easily made available in the openQRM Cloud. HowTo setup and use the openQRM Cloud is covered in another Howto at : http://www.openqrm-enterprise.com/news/details/article/howto-setup-your-own-openqrmcloud-with-kvm-on-ubuntu-lucid-lynx.html
Please save content as /home/[username]/.ec2/ec2rc Also please download your AWS Private-key and your AWS Certificate to /home/ [username]/.ec2/ After that please source the ec2rc and check the functionality of the ec2-tools by running ec2-describe-regions.
With the Amazon account credentials installed we are now setting up another Hybrid-Cloud account. Goto Plugins -> Components -> Deployment -> Hybrid-Cloud -> Accounts Provide an Account name (you can choose any name) Set the path to the EC2 rc-config file Set the path to the ssh-key file Set the type of the account
Now we are ready to export the openQRM Image. Goto Plugins -> Deployment -> Hybrid-Cloud -> Import Select your EC2 account
On the next screen provide a S3 bucket name for the AMI and configure region, size and architecture.
openQRM is now transferring the Image to the Amazon Cloud as a new AMI. It will be available for deployment after bundling and uploading the AMI finished. You can get a detailed log about the migration at /tmp/uecubuntuexport.export.debug.log. tail -f /tmp/uecubuntuexport.export.debug.log Same as for the Import you can also check the Event list for the progress. As soon as the migration finished the exported openQRM Image will be available at the Amazon EC2 Cloud. You can start it e.g. via the EC2 commadline tools on the openQRM Server. Open a terminal an run : . /home/[username]/.ec2/ec2rc ec2-run-instances [ami-name] -k [ssh-keypair]
Thanks
We hope you enjoyed this Howto with the focus on the hybrid-cloud features of openQRM !
Urls
UEC Installation Howto - https://help.ubuntu.com/community/UEC/CDInstall The openQRM Project http://www.openqrm.com openQRM Enterprise http://www.openqrm-enterprise.com openQRM Documentation - http://www.openqrm-enterprise.com/news/details/article/in-depth-documentation-of-openqrm-available.html openQRM Cloud HowTo - http://www.openqrm-enterprise.com/news/details/article/howto-setup-your-own-openqrm-cloud-with-kvm-on-ubuntu-lucid-lynx.html
http://www.openqrm-enterprise.com