We’ve been virtualizing our systems where I work for months now. OpenSuSE 11 with Xen virtualization and many OpenSuSE virtual servers on each physical server. Today that paid off big time, when I needed to clear one of the physical servers off, I was able to simply shutdown the virtual servers on that host, copy their logical volumes with dd commands piped through ssh over the network, tweak a couple of configuration files, and start up the virtual servers on the new physical server in only a few steps, and what would have only been a few minutes if I had made a typographical error the first time I tried the dd command.
It is simply amazing how far server technology has come in a very short time.
More details for those who care, after the fold…
Specific steps:
1) on the old dom0 (physical server), find the exact sizes of the logical volumes of the virtual servers you are moving with sudo lvs (we are using logical volume management for all but our dom0 boot partition, that helps make this easy)
2) on the new dom0, create LVMs that are identical in size to the old ones with lvcreate commands, one per logical volume you will need to duplicate the old dom0 environment
3) arrange for your short outage/downtime, and shutdown the old virtual servers (domU) on the old dom0 using xm destroy (note – you’ll also have to gracefully shutdown your own applications)
4) physically copy the data (potentially long running step if you have lots of it); from the old machine:
dd if=/dev/vg00/hostname01.subdomain.your.domain_root | ssh root@new_dom0.subdomain.your.domain "dd of=/dev/vg00/hostname01.subdomain.your.domain_root" dd if=/dev/vg00/hostname01.subdomain.your.domain_swap | ssh root@new_dom0.subdomain.your.domain "dd of=/dev/vg00/hostname01.subdomain.your.domain_swap"
5) copy the Xen config files over to the new dom0:
scp /etc/xen/vm/hostname01.subdomain.your.domain new_dom0.subdomain.your.domain:/etc/xen/vm/
6) change that file on the new dom0 so that the physical frame matches your new dom0 and link to the /etc/xen/auto witha symbolic link
7) xm create -c HOST
Absolutely amazing. Our host, it’s small postgresql and mysql databases, all it’s applications – all moved from problem hardware to new hardware in less time than it takes to get a coffee or burger made.
Xen virtualization rocks!
Post a Comment