The journey wasn’t so bad, but I did have to touch couple of things that I never used, things that I did a while back and forgot, things I didn’t know and so on. But this morning our QA lead Victor Iglesias helped with the missing parts, in other words the reason of my suffering for a while.
Anyway, so, here is what I did to get a cloud running in a vm on a Fedora 19 box.
Installed Fedora 19 on a core i5 Dell Inspiron laptop. It is better to have some free space in the volume group while installing Fedora. We will be creating a 100GB logical volume (LV) for the cloud VM later on. Also, if there is unallocated space available in the HDD, we can use that space for the LV.
The first thing I did is disabled selinux from /etc/selinux/config
For this setup, I decided to install the @virtualization from the base group installer to keep things simpler.
yum install @virtualization
Since we will have to run AWS-like instances inside a VM, we need to enabled the nested-kvm feature from kvm_intel module. By default nested kvm is off in most of the systems.
Open/Create the following file, /etc/modprobe.d/kvm-nested.conf and add this line,
options kvm_intel nested=1
Reboot the system to enable this nested virtualization feature.
Ensure that we have nested kvm enabled,
“Y” represents nested kvm availability.
More on nested-kvm, here.
Now we have to create bridge (e.g br0) for the VMs.
Once the VM setup is complete, it’s almost time to start the Faststart VM.
For this setup we used a 100GB logical volume (LV).
lvcreate -L 100G -n "fslv" "volumegroup"
If there is only unallocated space available on the HDD but no free space in the volume group, create a partition (e.g /dev/sda3). Then create physical volume and extend volume group,
pvcreate /dev/sda3 vgextend "volumegroup" /dev/sda3
Uncomment the following lines in /etc/libvirt/qemu.conf file,
vnc_listen = "0.0.0.0" vnc_password = "<password>" user = "root" group = "root"
Restart libvirtd service,
systemctl restart libvirtd.service
Copy the faststart-3.4.1.iso to /var/lib/libvirt/images/ directory.
Create a 3 liner script or run these commands manually,
#!/bin/bash virsh undefine fs dd if=/dev/zero of=/dev/fedora/fslv bs=1M count=1 virt-install --name fs --cpu host-passthrough --disk /dev/fedora/fslv --ram 4000 --cdrom $1 --graphics vnc,listen=0.0.0.0 --bridge br0
Make sure, to pass the iso file after –cdrom if you are running the above lines manually, otherwise pass the iso file as a argument with the script.
Connect to the instance with Fedora Remote Desktop Viewer or any other you like and follow the instruction to install Eucalyptus. For this installation I selected cloud-in-a-box to have all the component in the same box. This might take a while, so make sure you are caffeine enabled.
When the installation is completed, reboot the VM. In this case, you might have to start the VM again.
virsh --connect qemu:///system virsh # start fs
It will now configure the Eucalyptus cloud and within couple of minutes an Eucalyptus cloud will be ready with one basic image and one load-balancer image.
Connect the Eucalyptus hybrid user console with the VMs IP,
User Credentials: * Account: demo * Username: admin * Password: password
By default Eucalyptus Faststart installation creates admin and demo credentials.
Follow the Eucalyptus documentation to discover Eucalyptus more.
More on cloud in a vm: https://github.com/eucalyptus/eucalyptus/wiki/Eucalyptus-Virtual-Cloud