How to Run Rackspace Cloud Server Image on Local Computer? Will it not be great if we can run just a mirror copy of our whole server locally? Theoretically it is closer to the concept of Virtual Appliance. If you are used with the terminology, you can watch the video on Creating WordPress Virtual Appliance Guide.
Actually, the thing recently has been made official by Rackspace by feature. We are not describing the new method. For First Generation Cloud Servers, it is quite easy to run such image. But for the New Generation Performance Servers, in order to run Rackspace Cloud Server image on Local computer, you need to work and learn a bit more.
How to Run Rackspace Cloud Server Image on Local Computer : First Know the Basics
Actually, the mechanism is not so easy in the way we create a Virtual Appliance. The reason is security – it will be a dangerous situation if the system was not API based. There are huge number of basic questions and answers on Rackspace Cloud Server Image on official Website :
---
1 | http://www.rackspace.com/knowledge_center/article/cloud-images-frequently-asked-questions |
For security reasons, some parts are not exposed. Image storing is part of OpenStack Glance and OpenStack Swift. At emergency you will get the backup on request.
How to Run Rackspace Cloud Server Image on Local Computer
The hack to get the image was discovered by some users; if you go to Cloud Server Webpage, select the Images tab and create an on-demand image; in Cloud Files there should be the file there named like
1 | servername_date_number_somestring.tar.gz.0 |
You have to download the image to your server. The easiest way to do this on Ubuntu is to use Swift API based authentication.
1 2 | #Install Swift sudo apt-get install swift |
Then run it :
1 | swift -A https://auth.api.rackspacecloud.com/v1.0 -U username -K API_key download cloud servers myservername_YYYYMMDD_XXXXX_cloudserverZZZZZ.tar.gz.0 |
When the download is done, uncompress the downloaded file (tar zxf myservername_YYYYMMDD_XXXXX_cloudserverZZZZZ.tar.gz.0). There will be the following files:
1 2 3 4 | --image +-image.vhd +-manifest.ovf +-snap.vhd |
image.vhd is the thing we are interested, it has the root partition from the cloud server. We need to convert it to a raw disk image.
1 2 3 4 5 6 | #install the utility sudo apt-get install qemu-utils #convert the image.vhd to workable thing qemu-img convert -p image.vhd disk.img #perform a check fdisk -l disk.img |
Follow these steps :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | #swap volumes # LXYG should be like L30G, XY is yours lvcreate -LXYG -n myservername-disk vg0 and lvcreate -LXYG -Cy -n servername-swap vg0 # initialize the swap disk mkswap /dev/vg0/myservername-swap #copy disk image dd if=disk.img of=/dev/vg0/servername-disk bs=4096 skip=256 # check e2fsck -f /dev/vg0/myservername-disk resize2fs -p /dev/vg0/myservername-disk e2fsck -f /dev/vg0/myservername-disk # virtual disk settings on your virtual machine # creating grub menu.lst file. more tmp/etc/fstab more tmp/boot/grub/menu.lst # network settings of DomU nano tmp/etc/network/interfaces |
Editing the above is most critical.
Create a xen config file for your imported DomU :
1 | nano /etc/xen/servername.cfg |
Example config :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | name = "servername" bootloader = '/usr/lib/xen-default/bin/pygrub' #uncomment the following if you want to boot into single user mode #extra = " single" vcpus = '2' memory = '512' # # Disk device(s). (Use the correct mappings from step 12.) # disk = [ 'phy:/dev/vg0/myservername-disk,xvda1,w', 'phy:/dev/vg0/myservername-swap,xvda2,w', ] # # Networking # vif = [ 'bridge=xenbr0' ] # # Behaviour # on_poweroff = 'destroy' on_reboot = 'restart' on_crash = 'restart' |
Done, attach a console :
1 | xm create -c /etc/xen/myservername.cfg |
Those who are using Performance Server or higher, they have more flexibility. However, that is a different story.
Tagged With download Rackspace server image , https://thecustomizewindows com/2014/04/run-rackspace-cloud-server-image-local-computer/ , import rackspace image vhd grub , rackspace server imaging , run rackspace image locally