Showing posts with label 64-bit. Show all posts
Showing posts with label 64-bit. Show all posts

Wednesday, May 13, 2009

Xen: Move an LVM-based virtual machine to another host without shared storage between the two hosts

For those running Xen on servers with no back-end SAN, the following instructions detail the steps necessary to move an LVM-based virtual machine to a new physical host. There may be more elegant ways to achieve this, but this is what worked for me.

Environment
Ok, so let’s set the scene:

  • vmhost is a RHEL 5 server running several virtual machines using the Xen virtualization technology. Each virtual machine is allocated a 60 GB logical volume within an LVM volume group. One of these virtual machines, “win2k3vm”, needs to be moved to a new server.
  • new-vmhost is almost identical to vmhost, but has updated hardware and more memory. This is the server that “win2k3vm” will be moved to.


Migrate the Virtual Machine
1. Create a snapshot of virtual machine LVM volume. This can be run on a live virtual machine, but it is probably safer to perform a graceful shutdown of your virtual machine first.

[root@vmhost]# lvcreate -s -L 300m -n win2k3vm-snap VolGroup01

2. Export the snapshot of the guest VM to a file that can be moved between physical servers.

[root@vmhost]# dd if=/dev/VolGroup01/win2k3vm-snap of=/mnt/temp/win2k3vm.img bs=4096

3. Remove the snapshot LVM volume.

[root@vmhost]# lvremove /dev/VolGroup01/win2k3vm-snap

4. Copy the file to the new VM host. Make sure you have sufficient free drive space.

[root@vmhost]# scp /mnt/temp/win2k3vm.img user@new-vmhost:/mnt/temp/

5. On the new VM host, create an LVM volume that is at least as big as the guest VM file.

[root@new-vmhost]# lvcreate -n win2k3vm -L 60G VMGroup

6. Transfer the guest VM file to the new LVM volume.

[root@new-vmhost]# dd if=win2k3vm.img of=/dev/VMGroup/win2k3vm bs=4096

7. Copy the VM config file from the old VM host to the new VM host server.

[root@vmhost]# scp /etc/xen/win2k3vm user@new-vmhost:

8. Copy the file to the appropriate directory.

[usr@new-vmhost]$ sudo mv ~/win2k3vm /etc/xen/

Summary of Commands
[root@vmhost]# lvcreate -s -L 300m -n win2k3vm-snap VolGroup01
[root@vmhost]# dd if=/dev/VolGroup01/win2k3vm-snap of=/mnt/temp/win2k3vm.img bs=4096
[root@vmhost]# lvremove /dev/VolGroup01/win2k3vm-snap
[root@vmhost]# scp /mnt/temp/win2k3vm.img user@new-vmhost:/mnt/temp/
[root@new-vmhost]# lvcreate -n win2k3vm -L 60G VMGroup
[root@new-vmhost]# dd if=win2k3vm.img of=/dev/VMGroup/win2k3vm bs=4096
[root@vmhost]# scp /etc/xen/win2k3vm user@new-vmhost:
[usr@new-vmhost]$ sudo mv ~/win2k3vm /etc/xen/



Credit goes to: http://www.alethe.com/brad/2008/04/move-an-lvm-based-virtual-machine-to-another-host/ who these instructions were created by.

These instructions were perfect. Thanks Brad!

Tuesday, May 12, 2009

Xen: Converting a physical linux machine to xen virtual machine (fully virtualized) in Redhat Enterprise (64-bit)

I am running Redhat Enterprise Linux with xen virtualization. My server is a quad core 3ghz IBM x3550 server with 20gb of ram.

Today I had a need to move a standalone linux box into a xen vm. I had to keep the standalone machine completely intact as it was a build server which compiled code. The purpose of moving the build server to a xen VM was to test a build and see how long it took on the new VM machine compared to the older standalone server. The build server was fedora core 6 but I imagine this post applies to any machine, any software.


Preparing the standalone server
  1. Shut down the standalone machine
  2. Connect external USB disk to the system (use a disk that is larger then the drive in the system)
  3. Boot the standalone system with a linux boot cd (I used a ubuntu live recovery disk)
  4. Once the machine has booted the live cd, mount the external USB drive
  5. Use dd to make an image of the drive in the standalone server and output the image to a file on the USB drive: dd if=/dev/sda of=/mnt/usbdrive/standalone-server-image.dd (This will take some time)
  6. Once DD has completed, go ahead and shutdown the standalone machine, remove the USB drive, remove the Live CD and boot the machine back up to normal operation (if you will continue to use the standalone machine)
Preparing the Xen Server

Note: I am using LVM for my VM's. If you are not sure what this is, dont follow these instructions word for word

  1. Create a LV a little bit bigger then the original drive you imaged (my original was 80gb and I created a LV 100GB): # lvcreate -L100G -n newserver_vm /dev/data
  2. Copy the image of the standalone server to the new LV you just created:# dd if=/mnt/usb/standalone-server-image.dd of=/dev/data/newserver_vm
  3. Create a Xen configuration file for the new virtual machine (usually located in /etc/xen/
# /etc/xen/newserver_vm

import os, re
arch = os.uname()[4]

#I had to change the line below to match the path of where hvmloader was
kernel = "/usr/lib/xen/boot/hvmloader"

builder='hvm'

memory = 512
shadow_memory = 8

#change the line below to reflect the name of your vm
name = "newserver_vm"

#change the line below to match your network bridge. I copied and pasted this line from
#another working VM in xen that I started from scratch. Xen networking is a whole another
#blog!
vif = [ "mac=00:16:3e:15:f5:a6,bridge=xenbr0" ]

# I had to change the line below to match the patch of qemu-dm
device_model = '/usr/lib64/xen/bin/qemu-dm'
# boot on floppy (a), hard disk (c) or CD-ROM (d)
# default: hard disk, cd-rom, floppy
boot="dc"

sdl=0
vnc=1
vnclisten="0.0.0.0"
vncconsole=1
stdvga=0
serial='pty'

on_poweroff = 'destroy'
on_reboot = 'restart'
on_crash = 'restart'

#make sure this matches the LV you created and copied the standalone image to
disk = [ "phy:/dev/data/buildserver_vm,xvda,w" ]

Start the new VM

# xm create /etc/xen/newserver_vm

Once I started the new VM I used the gui xen manager in redhat. I could not get to the console from command line by starting the vm with "-c"


I hope this helps. This is made more as a reference then a step by step guide. Feel free to comment back with questions or suggestions.

Sunday, May 10, 2009

Sharepoint: Indexing pdf files in sharepoint moss 2007 windows 2008 64-bit

After following a couple different instructions I found on the web here is the real deal. Follow the instructions in this link:

http://www.adobe.com/special/acrobat/configuring_pdf_ifilter_for_ms_sharepoint_2007.pdf


Worked great for me. Let me know if you have problems.