<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Hi Will,<br>
<br>
That's an interesting idea.&nbsp; The only thing that would have made that
impractical was the VM actually had a 60GB hard drive but was only
using 1.7GB of disk space.&nbsp; I didn't want to install a newer Linux
version and try to migrate the applications and data because it was
work-time I didn't want to waste because the applications were working
perfectly fine in the existing VM.&nbsp; The only reason to move it was the
old &amp; busted hypervisor.<br>
<br>
Here's what I actually did to move this VM without needing a Ubuntu
boot CD that could boot this VM:<br>
<br>
1. Boot the old VM from CentOS 6 x86_64 netinstall CD, in rescue mode.<br>
2. Make a tarball of the entire filesystem.<br>
3. Copy the tarball to a 3rd system.<br>
4. Boot the new VM from the CentOS 6 x86_64 netinstall CD, in rescue
mode.<br>
5. Create the same disk partitions and filesystems structure that the
old VM had, and mount them as required.<br>
6. Untar the tarball into the root filesystem of the new VM.<br>
7. While still booted from the CD, I changed to the VM's root
filesystem root directory and did chroot .&nbsp; Once I did 'exec /bin/bash'
and 'mount /proc' I was effectively in the VM's operating system
environment with most everything fully operational, even though I had
originally booted from the live CD.<br>
8. Edit /etc/fstab to reflect the new device names, because the Ubuntu
installer had set UUIDs on the partitions and I just wanted to use
/dev/sda1 etc. for the device names, mostly because I didn't care to
figure out or learn how to assign a UUID to each device &amp; partition.<br>
9. I had to create /dev/sda and /dev/sda1 device nodes because I guess
Ubuntu was populating the /dev directory block devices automatically.&nbsp;
'mknod /dev/sda b 8 0' and so on.<br>
10. Once the device nodes existed, I ran grub-install and it installed
the boot loader in the boot sector of the VM disk.<br>
11. It turned out I had to edit a grub configuration file to set the
boot device and root filesystem to be /dev/sda1 (hd0,0) instead of the
UUID baloney.&nbsp; Then I re-ran grub-install, and it booted from the new
VM's disk.<br>
12. I had to edit the udev 70-persistent-net-rules because the MAC
addresses of the ethernet interfaces were different in the new VM.<br>
<br>
This took about an hour and a half total, and most of that time was
spent trying to understand grub's obscure error messages which were
totally unhelpful to understand that it was refusing to boot because
the disk &amp; partitions didn't have the UUIDs that it expected.&nbsp; Once
I got rid of all traces of UUIDs from the grub config file then grub
worked as expected.<br>
<br>
Thanks everyone for the ideas &amp; advice, I really appreciate it.<br>
<br>
Jim<br>
-- <br>
Jim Ockers, P.E., P.Eng. (<a class="moz-txt-link-abbreviated" href="mailto:ockers@ockers.net">ockers@ockers.net</a>)<br>
Contact info: <a class="moz-txt-link-freetext" href="http://www.ockers.net/msi.html">http://www.ockers.net/msi.html</a><br>
<br>
<br>
<br>
Will wrote:
<blockquote
 cite="mid:CANTPGZYqcM-Z9=xOri-13ueWznFBxbV9=XwB_F5jsjyU-mBh3Q@mail.gmail.com"
 type="cite">Instead of moving the existing disk images just make new
images using DD. &nbsp;Most hyper visors can use DD created disk images and
if they can not just create a empty disk image boot the VM from CD and
then use DD to copy the disk image over to the empty drive.
  <div><br>
  </div>
  <div>
  <ol>
    <li>Boot old VM from media, get it on the LAN.</li>
    <li>Boot new VM from media get it on the LAN</li>
    <li>on new VM 'ssh root@oldvm "dd if=/dev/sda"|dd of=/dev/sda'</li>
    <li>Boot new VM from sda</li>
  </ol>
  <br>
  <div class="gmail_quote">On Mon, Feb 6, 2012 at 12:21 PM, Jim Ockers <span
 dir="ltr">&lt;<a moz-do-not-send="true" href="mailto:ockers@ockers.net">ockers@ockers.net</a>&gt;</span>
wrote:<br>
  <blockquote class="gmail_quote"
 style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
    <div bgcolor="#ffffff" text="#000000"><font size="+1"><tt>Hi
CLUEbies,<br>
    <br>
I'm moving a Ubuntu 8.10 system from one VM hypervisor to another.&nbsp;
Since the VM disk formats are incompatible I have to recreate the
filesystem on the new VM and I thought I would just copy the filesystem
over the network.&nbsp; The only thing that won't be copied over is the
ability of the new VM to boot from the hard disk.<br>
    <br>
Red Hat/CentOS makes this easy because there's the mkbootdisk utility
with --iso command line.&nbsp; Using that, I can make a bootable CD that
will boot my system without anything set up on the hard disk.&nbsp; Once
booted from the ISO, I can re-run grub and am good to go.&nbsp; The only
issue is getting the new VM booted in the first place.<br>
    <br>
The Ubuntu 'mkboot' utility is stupid and busted.&nbsp; One of its bugs is
from the man page for mkboot(8) is "mkboot only works on floppy
diskette drives."&nbsp; Since this is a VM there is no floppy disk drive,
real or virtual, on the server or hypervisor.&nbsp; Frankly I'm really
un-impressed with Ubuntu, but then again I'm from the Red Hat/CentOS
school of general awesomeness, so maybe I'm missing something. :)&nbsp; Feel
free to flame away but the only thing that will really impress me is if
there is some Ubuntu-ish easy way of doing the same thing (such as
moving/cloning systems) that Red Hat has let me do for years.<br>
    <br>
Is there some other EASY way to make this Ubuntu system boot exactly
its kernel, with its own initrd, from a CD-ROM (ISO image, really)?&nbsp;
This is a headless server with no GUI.&nbsp; I also don't want to a make
bootable USB flash drive which is what most of my googling indicates
that most Ubuntu users are trying to do.&nbsp; I'm also not going to
reinstall Ubuntu and reconfigure all of the services and custom stuff
that's installed in this VM.<br>
    <br>
You might think I should have to go try to dig up a USB floppy disk
drive and assign it to the VM to try to get this to work.&nbsp; For one
thing, that level of old-schoolness is not really my style, but for
another thing this VM hypervisor has "issues" with assigning USB
devices to VMs, and so it wouldn't work anyway.&nbsp; (Which is a big part
of why I'm moving the whole thing to a different VM hypervisor.)<br>
    <br>
Thanks,<br>
Jim<span class="HOEnZb"><font color="#888888"><br>
    </font></span></tt></font><span class="HOEnZb"><font color="#888888">
    <pre cols="72">-- 
Jim Ockers, P.E., P.Eng. (<a moz-do-not-send="true"
 href="mailto:ockers@ockers.net" target="_blank">ockers@ockers.net</a>)
Contact info: <a moz-do-not-send="true"
 href="http://www.ockers.net/msi.html" target="_blank">http://www.ockers.net/msi.html</a>

    </pre>
    </font></span></div>
  </blockquote>
  </div>
  </div>
</blockquote>
<br>
<br>
</body>
</html>