Tom Haddon
2008-Jul-10 21:41 UTC
[Xen-users] Migrating from -xen guest kernel to unmodified guest kernel
Hi Folks, I''m trying to switch a guest from using a -xen guest kernel to using an unmodified guest kernel. Looking at the disk layout on my current guest I see the following: mthaddon@dapper:~$ sudo fdisk -l Password: Disk /dev/hda1: 4294 MB, 4294967296 bytes 255 heads, 63 sectors/track, 522 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk /dev/hda1 doesn''t contain a valid partition table Disk /dev/hda2: 268 MB, 268435456 bytes 255 heads, 63 sectors/track, 32 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk /dev/hda2 doesn''t contain a valid partition table My disk config looks like this: disk = [ ''tap:aio:/srv/xen/domains/dapper/disk.img,hda1,w'' , ''tap:aio:/srv/xen/domains/dapper/swap.img,hda2,w'' ] As I understand it, there are a few things that I''d need to do to be able to do this. 1) Install the kernel on the guest itself, and configure grub on the guest itself to boot that kernel 2) Because I need to install grub, I need to switch from using file-based partitions (/dev/hda1) to file-based disks (/dev/hda with /dev/hda1 and /dev/hda2 as a partition within that). I think that what I may need to do is build the whole /dev/hda disk image from scratch, and then mount it as a loopback device, and create the partition layout I want and format the partitions as ext3 and swap respectively. Then I should also mount the current /dev/hda1 image as loopback devices, and then copy everything into the first partition. Then I should be able to change my disk config to: disk = [ ''tap:aio:/srv/xen/domains/dapper/new_disk.img,hda,w'' ] I''d then boot into it and install grub, shut it down, change the config to use hvmloader, and then boot again. Does this sound sane? Part of the reason I need to avoid just building a new unmodified kernel guest from scratch is that I can''t seem to get console access to the xen guest when it''s using hvm (I think this isn''t supported from what I can see), and I don''t have firewall access to be able to get to the server on a vnc port. I also can''t get xen to work on my current laptop (kernel panic), so I''m stuck with trying to do things directly on the server. I did also try creating a VM in qemu on my local machine and then copying that up to the server. It seems to boot, and xm list reports it''s running, but something seems to be messed up in the networking side of things, as I can''t connect to it via ssh (even though I can if I run it locally in qemu), and xm console <guest_name> fails too. Many thanks for any help. Tom _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Fajar A. Nugraha
2008-Jul-11 02:18 UTC
Re: [Xen-users] Migrating from -xen guest kernel to unmodified guest kernel
Tom Haddon wrote:> I''d then boot into it and install grub, shut it down, change the config > to use hvmloader, and then boot again. Does this sound sane? >Pretty much so.> Part of the reason I need to avoid just building a new unmodified kernel > guest from scratch is that I can''t seem to get console access to the xen > guest when it''s using hvm (I think this isn''t supported from what I can > see)If I were you I''d simply install from scratch. I used HVM to install opensolaris under linux once. I was able to access its serial console using this xen config : serial=''pty'' that way you can "xm console"-it just like a PV domain. There are other complications though : You need to follow the same procedure (for the HVM domU) as if you have a real machine with both VGA card and serial port, and you want to use only the serial port. In my case, when the opensolaris installer boots, initially the output is only on VGA console (accessible using vnc). I have to choose "install using serial port" (or something like that), and after that all output is on the serial port (accessible using xm console).> , and I don''t have firewall access to be able to get to the server > on a vnc port.AFAIK you should be able to use TCP/X forwarding with ssh for vnc/SDL console. Regards, Fajar _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Tom Haddon
2008-Jul-14 16:59 UTC
[Xen-users] Re: Migrating from -xen guest kernel to unmodified guest kernel
On Thu, 2008-07-10 at 22:41 +0100, Tom Haddon wrote:> Hi Folks, > > I''m trying to switch a guest from using a -xen guest kernel to using an > unmodified guest kernel.> As I understand it, there are a few things that I''d need to do to be > able to do this. > > 1) Install the kernel on the guest itself, and configure grub on the > guest itself to boot that kernel > 2) Because I need to install grub, I need to switch from using > file-based partitions (/dev/hda1) to file-based disks (/dev/hda > with /dev/hda1 and /dev/hda2 as a partition within that). > > I think that what I may need to do is build the whole /dev/hda disk > image from scratch, and then mount it as a loopback device, and create > the partition layout I want and format the partitions as ext3 and swap > respectively. Then I should also mount the current /dev/hda1 image as > loopback devices, and then copy everything into the first partition. > > Then I should be able to change my disk config to: > > disk = [ ''tap:aio:/srv/xen/domains/dapper/new_disk.img,hda,w'' ] > > I''d then boot into it and install grub, shut it down, change the config > to use hvmloader, and then boot again. Does this sound sane?I was successfully able to do this, and can now boot into the new guest with the unmodified kernel. However, networking doesn''t work. (I figured out how to connect via vnc through an ssh tunnel). In other words, the network setup works fine with the -xen kernel, but not with the unmodified kernel. Anyone have any ideas why that might be?> > Part of the reason I need to avoid just building a new unmodified kernel > guest from scratch is that I can''t seem to get console access to the xen > guest when it''s using hvm (I think this isn''t supported from what I can > see), and I don''t have firewall access to be able to get to the server > on a vnc port. I also can''t get xen to work on my current laptop (kernel > panic), so I''m stuck with trying to do things directly on the server.Since I have the ssh tunnel and a vnc connection, I thought I''d just try installing from scratch. However, I''m having some problems with that too. If I use disk type "tap:aio:" (which is what I''ve been using in my guests to date) the guest just dies immediately with no useful error message. If I change both the hda and cdrom to "file:" the guest goes into immediate "pause" mode. If I force "unpause" I can carry on with the install but it fails trying to setup disks as part of the install with the output: Error: Device 768 (vbd) could not be connected. losetup /dev/loop6 /srv/xen/domains/dapper/hvmfulldisk.img failed Any ideas? Cheers, Tom> > Many thanks for any help. > > Tom_______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
I need to control what the machine shows and /proc/cpuinfo. For example, my virtual machine shows 8 CPU''s, but I think that these look like independent CPU''s to the apps. I need to change this to look like they are two cpu''s and 4 cores per cpu. I need this because my software licensing requires this scheme and also because it is actually true, I have four physical CPU''s and 4 cores each. cat /proc/cpuinfo processor : 0 vendor_id : GenuineIntel cpu family : 6 model : 15 model name : Intel(R) Xeon(R) CPU X7350 @ 2.93GHz stepping : 11 cpu MHz : 2925.864 cache size : 4096 KB physical id : 0 siblings : 1 core id : 0 cpu cores : 1 fpu : yes fpu_exception : yes cpuid level : 10 wp : yes flags : fpu de tsc msr pae mce cx8 apic sep mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm syscall nx lm constant_tsc pni monitor ds_cpl vmx est tm2 cx16 xtpr dca lahf_lm bogomips : 5863.85 clflush size : 64 cache_alignment : 64 address sizes : 40 bits physical, 48 bits virtual power management: processor : 1 vendor_id : GenuineIntel cpu family : 6 model : 15 model name : Intel(R) Xeon(R) CPU X7350 @ 2.93GHz stepping : 11 cpu MHz : 2925.864 cache size : 4096 KB physical id : 4 siblings : 1 core id : 1 cpu cores : 1 fpu : yes fpu_exception : yes cpuid level : 10 wp : yes flags : fpu de tsc msr pae mce cx8 apic sep mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm syscall nx lm constant_tsc pni monitor ds_cpl vmx est tm2 cx16 xtpr dca lahf_lm bogomips : 5863.85 clflush size : 64 cache_alignment : 64 address sizes : 40 bits physical, 48 bits virtual power management: processor : 2 vendor_id : GenuineIntel cpu family : 6 model : 15 model name : Intel(R) Xeon(R) CPU X7350 @ 2.93GHz stepping : 11 cpu MHz : 2925.864 cache size : 4096 KB physical id : 6 siblings : 1 core id : 1 cpu cores : 1 fpu : yes fpu_exception : yes cpuid level : 10 wp : yes flags : fpu de tsc msr pae mce cx8 apic sep mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm syscall nx lm constant_tsc pni monitor ds_cpl vmx est tm2 cx16 xtpr dca lahf_lm bogomips : 5863.85 clflush size : 64 cache_alignment : 64 address sizes : 40 bits physical, 48 bits virtual power management: processor : 3 vendor_id : GenuineIntel cpu family : 6 model : 15 model name : Intel(R) Xeon(R) CPU X7350 @ 2.93GHz stepping : 11 cpu MHz : 2925.864 cache size : 4096 KB physical id : 0 siblings : 1 core id : 3 cpu cores : 1 fpu : yes fpu_exception : yes cpuid level : 10 wp : yes flags : fpu de tsc msr pae mce cx8 apic sep mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm syscall nx lm constant_tsc pni monitor ds_cpl vmx est tm2 cx16 xtpr dca lahf_lm bogomips : 5863.85 clflush size : 64 cache_alignment : 64 address sizes : 40 bits physical, 48 bits virtual power management: processor : 4 vendor_id : GenuineIntel cpu family : 6 model : 15 model name : Intel(R) Xeon(R) CPU X7350 @ 2.93GHz stepping : 11 cpu MHz : 2925.864 cache size : 4096 KB physical id : 2 siblings : 1 core id : 3 cpu cores : 1 fpu : yes fpu_exception : yes cpuid level : 10 wp : yes flags : fpu de tsc msr pae mce cx8 apic sep mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm syscall nx lm constant_tsc pni monitor ds_cpl vmx est tm2 cx16 xtpr dca lahf_lm bogomips : 5863.85 clflush size : 64 cache_alignment : 64 address sizes : 40 bits physical, 48 bits virtual power management: processor : 5 vendor_id : GenuineIntel cpu family : 6 model : 15 model name : Intel(R) Xeon(R) CPU X7350 @ 2.93GHz stepping : 11 cpu MHz : 2925.864 cache size : 4096 KB physical id : 4 siblings : 1 core id : 3 cpu cores : 1 fpu : yes fpu_exception : yes cpuid level : 10 wp : yes flags : fpu de tsc msr pae mce cx8 apic sep mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm syscall nx lm constant_tsc pni monitor ds_cpl vmx est tm2 cx16 xtpr dca lahf_lm bogomips : 5863.85 clflush size : 64 cache_alignment : 64 address sizes : 40 bits physical, 48 bits virtual power management: processor : 6 vendor_id : GenuineIntel cpu family : 6 model : 15 model name : Intel(R) Xeon(R) CPU X7350 @ 2.93GHz stepping : 11 cpu MHz : 2925.864 cache size : 4096 KB physical id : 6 siblings : 1 core id : 3 cpu cores : 1 fpu : yes fpu_exception : yes cpuid level : 10 wp : yes flags : fpu de tsc msr pae mce cx8 apic sep mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm syscall nx lm constant_tsc pni monitor ds_cpl vmx est tm2 cx16 xtpr dca lahf_lm bogomips : 5863.85 clflush size : 64 cache_alignment : 64 address sizes : 40 bits physical, 48 bits virtual power management: processor : 7 vendor_id : GenuineIntel cpu family : 6 model : 15 model name : Intel(R) Xeon(R) CPU X7350 @ 2.93GHz stepping : 11 cpu MHz : 2925.864 cache size : 4096 KB physical id : 0 siblings : 1 core id : 0 cpu cores : 1 fpu : yes fpu_exception : yes cpuid level : 10 wp : yes flags : fpu de tsc msr pae mce cx8 apic sep mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm syscall nx lm constant_tsc pni monitor ds_cpl vmx est tm2 cx16 xtpr dca lahf_lm bogomips : 5863.85 clflush size : 64 cache_alignment : 64 address sizes : 40 bits physical, 48 bits virtual power management: _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Tom Haddon
2008-Jul-14 22:49 UTC
[Xen-users] Re: Migrating from -xen guest kernel to unmodified guest kernel
On Mon, 2008-07-14 at 09:59 -0700, Tom Haddon wrote:> On Thu, 2008-07-10 at 22:41 +0100, Tom Haddon wrote: > > Hi Folks, > > > > I''m trying to switch a guest from using a -xen guest kernel to using an > > unmodified guest kernel. > > > As I understand it, there are a few things that I''d need to do to be > > able to do this. > > > > 1) Install the kernel on the guest itself, and configure grub on the > > guest itself to boot that kernel > > 2) Because I need to install grub, I need to switch from using > > file-based partitions (/dev/hda1) to file-based disks (/dev/hda > > with /dev/hda1 and /dev/hda2 as a partition within that). > > > > I think that what I may need to do is build the whole /dev/hda disk > > image from scratch, and then mount it as a loopback device, and create > > the partition layout I want and format the partitions as ext3 and swap > > respectively. Then I should also mount the current /dev/hda1 image as > > loopback devices, and then copy everything into the first partition. > > > > Then I should be able to change my disk config to: > > > > disk = [ ''tap:aio:/srv/xen/domains/dapper/new_disk.img,hda,w'' ] > > > > I''d then boot into it and install grub, shut it down, change the config > > to use hvmloader, and then boot again. Does this sound sane? > > I was successfully able to do this, and can now boot into the new guest > with the unmodified kernel. However, networking doesn''t work. (I figured > out how to connect via vnc through an ssh tunnel). In other words, the > network setup works fine with the -xen kernel, but not with the > unmodified kernel. Anyone have any ideas why that might be?I was missing "type:ioemu" and "bridge=xenbr0" from my networking config section. Seems to be all working now. Thanks, Tom _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users