jun hu
2012-Oct-06 13:38 UTC
how to boot a para-virtulized vm from cdrom after installation
how to boot a para-virtulized vm from cdrom after installation? I tried to modify the vm conf file :boot=“dc", but It still boot from disk quickly. HjCloud:/mnt/winimg/xen_vm_config # xm li Name ID Mem VCPUs State Time(s) Domain-0 0 3336 2 r----- 481.1 sles10sp4 512 2 0.0 sles11sp2pv 2 512 2 -b---- 13.4 HjCloud:/mnt/winimg/xen_vm_config # cat sles11sp2pv name="sles11sp2pv" description="None" uuid="a53f984b-b4f5-9206-adf8-e84cdbe20ff5" memory=512 maxmem=512 vcpus=2 on_poweroff="destroy" on_reboot="restart" on_crash="preserve" localtime=0 keymap="en-us" builder="linux" bootloader="/usr/bin/pygrub" bootargs="" extra=" " boot="dc" disk=[ 'phy:/dev/domu/sp2,xvda,w', 'file:/mnt/winimg/iso/SLES-11-SP2-DVD-x86_64-GM-DVD1.iso,xvdb:cdrom,r', ] vif=[ 'mac=00:16:3e:2d:53:f2,bridge=br0', ] vfb=['type=vnc,vncunused=1'] _______________________________________________ Xen-users mailing list Xen-users@lists.xen.org http://lists.xen.org/xen-users
Mark Pryor
2012-Oct-06 17:34 UTC
Re: how to boot a para-virtulized vm from cdrom after installation
Jun, before you try again, mount the ISO and copy locally the vmlinuz-xen/initrd-xen from the DVD. Those two files will be referenced from your config or the xm/xl cmdline. In your disk=[] line, put the DVD first (sometimes it matters). Now, xm create kernel=/home/me/vmlinuz-xen ramdisk=/home/me/initrd-xen xen_vm_config the boot files should now see the DVD and source it. -- Mark ________________________________ From: jun hu <duanshuidao@hotmail.com> To: "xen-users@lists.xen.org" <xen-users@lists.xen.org>; xen-users <xen-users@lists.xensource.com> Sent: Saturday, October 6, 2012 6:38 AM Subject: [Xen-users] how to boot a para-virtulized vm from cdrom after installation how to boot a para-virtulized vm from cdrom after installation? I tried to modify the vm conf file :boot=“dc", but It still boot from disk quickly. HjCloud:/mnt/winimg/xen_vm_config # xm li Name ID Mem VCPUs State Time(s) Domain-0 0 3336 2 r----- 481.1 sles10sp4 512 2 0.0 sles11sp2pv 2 512 2 -b---- 13.4 HjCloud:/mnt/winimg/xen_vm_config # cat sles11sp2pv name="sles11sp2pv" description="None" uuid="a53f984b-b4f5-9206-adf8-e84cdbe20ff5" memory=512 maxmem=512 vcpus=2 on_poweroff="destroy" on_reboot="restart" on_crash="preserve" localtime=0 keymap="en-us" builder="linux" bootloader="/usr/bin/pygrub" bootargs="" extra=" " boot="dc" disk=[ 'phy:/dev/domu/sp2,xvda,w', 'file:/mnt/winimg/iso/SLES-11-SP2-DVD-x86_64-GM-DVD1.iso,xvdb:cdrom,r', ] vif=[ 'mac=00:16:3e:2d:53:f2,bridge=br0', ] vfb=['type=vnc,vncunused=1'] _______________________________________________ _______________________________________________ Xen-users mailing list Xen-users@lists.xen.org http://lists.xen.org/xen-users
jun hu
2012-Oct-06 22:37 UTC
Re: how to boot a para-virtulized vm from cdrom after installation
Mark, I tried it, but still failed. If I use bootloader="/usr/bin/pygrub" and kernel ,ramdisk paramter, HjCloud:/mnt/winimg/xen_vm_config # xm cre kernel=/mnt/winimg/xen_vm_config/sles11sp2_iso_boot/vmlinuz-xen ramdisk=/mnt/winimg/xen_vm_config/sles11sp2_iso_boot/initrd-xen sles11sp2pv Using config file "./sles11sp2pv". Error: Boot loader didn't return any data! so , I commented the bootloader line ,vm's conf is as follows ,but failed too, I got the screenshot in the attachment. meanwhile , I find http://www.gossamer-threads.com/lists/xen/users/187703 , maybe for pvm , boot from cdrom is impossible ? thanks ! name="sles11sp2pv" description="None" uuid="a53f984b-b4f5-9206-adf8-e84cdbe20ff5" memory=512 maxmem=512 vcpus=2 on_poweroff="destroy" on_reboot="restart" on_crash="preserve" localtime=0 keymap="en-us" builder="linux" #bootloader="/usr/bin/pygrub" bootargs="" extra=" " ##boot="cd" #first disk,then cdrom kernel="/mnt/winimg/xen_vm_config/sles11sp2_iso_boot/vmlinuz-xen" ramdisk="/mnt/winimg/xen_vm_config/sles11sp2_iso_boot/initrd-xen" disk=[ #'file:/mnt/winimg/iso/SLES-11-SP2-DVD-x86_64-GM-DVD1.iso,xvdb:cdrom,r', 'file:/mnt/winimg/iso/SLES-11-SP2-DVD-x86_64-GM-DVD1.iso,hdc:cdrom,r', 'phy:/dev/domu/sp2,xvda,w', ] vif=[ 'mac=00:16:3e:2d:53:f2,bridge=br0', ] vfb=['type=vnc,vncunused=1']> Date: Sat, 6 Oct 2012 10:34:55 -0700 > From: tlviewer@yahoo.com > To: duanshuidao@hotmail.com; xen-users@lists.xen.org; xen-users@lists.xensource.com > Subject: Re: [Xen-users] how to boot a para-virtulized vm from cdrom after installation > > Jun, > > before you try again, mount the ISO and copy locally the vmlinuz-xen/initrd-xen from the DVD. > > Those two files will be referenced from your config or the xm/xl cmdline. > > In your disk=[] line, put the DVD first (sometimes it matters). > > Now, > xm create kernel=/home/me/vmlinuz-xen ramdisk=/home/me/initrd-xen xen_vm_config > > the boot files should now see the DVD and source it. > > -- > > Mark > > > ________________________________ > From: jun hu <duanshuidao@hotmail.com> > To: "xen-users@lists.xen.org" <xen-users@lists.xen.org>; xen-users <xen-users@lists.xensource.com> > Sent: Saturday, October 6, 2012 6:38 AM > Subject: [Xen-users] how to boot a para-virtulized vm from cdrom after installation > > > > how to boot a para-virtulized vm from cdrom after installation? > > > I tried to modify the vm conf file :boot=“dc", but It still boot from disk quickly. > > > > > HjCloud:/mnt/winimg/xen_vm_config # xm li > > Name ID Mem VCPUs State Time(s) > Domain-0 0 3336 2 r----- 481.1 > sles10sp4 512 2 0.0 > sles11sp2pv 2 512 2 -b---- 13.4 > HjCloud:/mnt/winimg/xen_vm_config # cat sles11sp2pv > name="sles11sp2pv" > description="None" > uuid="a53f984b-b4f5-9206-adf8-e84cdbe20ff5" > memory=512 > maxmem=512 > vcpus=2 > on_poweroff="destroy" > on_reboot="restart" > on_crash="preserve" > localtime=0 > keymap="en-us" > builder="linux" > bootloader="/usr/bin/pygrub" > bootargs="" > extra=" " > boot="dc" > disk=[ 'phy:/dev/domu/sp2,xvda,w', > 'file:/mnt/winimg/iso/SLES-11-SP2-DVD-x86_64-GM-DVD1.iso,xvdb:cdrom,r', ] > vif=[ 'mac=00:16:3e:2d:53:f2,bridge=br0', ] > vfb=['type=vnc,vncunused=1'] > _______________________________________________ > > _______________________________________________ > Xen-users mailing list > Xen-users@lists.xen.org > http://lists.xen.org/xen-users_______________________________________________ Xen-users mailing list Xen-users@lists.xen.org http://lists.xen.org/xen-users
Alexandre Kouznetsov
2012-Oct-08 16:08 UTC
Re: how to boot a para-virtulized vm from cdrom after installation
Hello. El 06/10/12 08:38, jun hu escribió:> how to boot a para-virtulized vm from cdrom after installation?In short, it does not work that way. When you decide "where to boot from", it implies there is some piece of code (BIOS, for example) that will look for a bootloader on some device. This is perfectly valid in HVM mode of operation, but not in PV. In case of Para-Virtualized DomU, the hypervisor itself loads the kernel, specified in the config file. There is no BIOS or bootloader residing in the MBR of a block device. There is no no such thing as "boot device" or "boot order". You can try this: 1. Hard way. Set up a new, completely new, HVM DomU. Attach your former PV DomU to it and boot form CD. 2. Depends on what you need to achieve over your DomU, it almost certainly possible to be done from Dom0. Greetings. -- Alexandre Kouznetsov
jun hu
2012-Oct-08 20:48 UTC
Re: how to boot a para-virtulized vm from cdrom after installation
thanks a lot I see you now from hujun's iphone 在 2012-10-9,0:11,"Alexandre Kouznetsov" <alk@ondore.com> 写道:> Hello. > > El 06/10/12 08:38, jun hu escribió: >> how to boot a para-virtulized vm from cdrom after installation? > > In short, it does not work that way. > > When you decide "where to boot from", it implies there is some piece of code (BIOS, for example) that will look for a bootloader on some device. This is perfectly valid in HVM mode of operation, but not in PV. > > In case of Para-Virtualized DomU, the hypervisor itself loads the kernel, specified in the config file. There is no BIOS or bootloader residing in the MBR of a block device. There is no no such thing as "boot device" or "boot order". > > You can try this: > 1. Hard way. Set up a new, completely new, HVM DomU. Attach your former PV DomU to it and boot form CD. > > 2. Depends on what you need to achieve over your DomU, it almost certainly possible to be done from Dom0. > > Greetings. > > -- > Alexandre Kouznetsov > > > _______________________________________________ > Xen-users mailing list > Xen-users@lists.xen.org > http://lists.xen.org/xen-users_______________________________________________ Xen-users mailing list Xen-users@lists.xen.org http://lists.xen.org/xen-users
Nick Couchman
2012-Oct-09 14:41 UTC
Re: how to boot a para-virtulized vm from cdrom after installation
>>> On 2012/10/08 at 10:08, Alexandre Kouznetsov <alk@ondore.com> wrote:> Hello. > > El 06/10/12 08:38, jun hu escribió: >> how to boot a para-virtulized vm from cdrom after installation? > > In short, it does not work that way. > > When you decide "where to boot from", it implies there is some pieceof> code (BIOS, for example) that will look for a bootloader on somedevice.> This is perfectly valid in HVM mode of operation, but not in PV. > > In case of Para-Virtualized DomU, the hypervisor itself loads the > kernel, specified in the config file. There is no BIOS or bootloader> residing in the MBR of a block device. There is no no such thing as > "boot device" or "boot order". > > You can try this: > 1. Hard way. Set up a new, completely new, HVM DomU. Attach yourformer> PV DomU to it and boot form CD. > > 2. Depends on what you need to achieve over your DomU, it almost > certainly possible to be done from Dom0. >It''s worth noting that some of the Xen management tools, like virt-manager (open source Xen) and XenCenter (XenServer/XCP) try to help you with this process. If you choose to boot one of these from a CD, the management tool goes out and looks in common locations for a Xen-based kernel, copies the kernel and initrd over to a temp location, and boots the VM in PV mode with the CD/DVD attached. This makes the process transparent to the end user, but it still is not truly booting off of a CD. Most modern Linux distributions have a Xen kernel and initrd located somewhere on the install media for just this purpose. -Nick -------- This e-mail may contain confidential and privileged material for the sole use of the intended recipient. If this email is not intended for you, or you are not responsible for the delivery of this message to the intended recipient, please note that this message may contain SEAKR Engineering (SEAKR) Privileged/Proprietary Information. In such a case, you are strictly prohibited from downloading, photocopying, distributing or otherwise using this message, its contents or attachments in any way. If you have received this message in error, please notify us immediately by replying to this e-mail and delete the message from your mailbox. Information contained in this message that does not relate to the business of SEAKR is neither endorsed by nor attributable to SEAKR.
Ian Campbell
2012-Oct-09 14:49 UTC
Re: how to boot a para-virtulized vm from cdrom after installation
On Tue, 2012-10-09 at 15:41 +0100, Nick Couchman wrote:> >>> On 2012/10/08 at 10:08, Alexandre Kouznetsov <alk@ondore.com> wrote: > > > Hello. > > > > El 06/10/12 08:38, jun hu escribió: > >> how to boot a para-virtulized vm from cdrom after installation? > > > > In short, it does not work that way. > > > > When you decide "where to boot from", it implies there is some piece > of > > code (BIOS, for example) that will look for a bootloader on some > device. > > This is perfectly valid in HVM mode of operation, but not in PV. > > > > In case of Para-Virtualized DomU, the hypervisor itself loads the > > kernel, specified in the config file. There is no BIOS or bootloader > > > residing in the MBR of a block device. There is no no such thing as > > "boot device" or "boot order". > > > > You can try this: > > 1. Hard way. Set up a new, completely new, HVM DomU. Attach your > former > > PV DomU to it and boot form CD. > > > > 2. Depends on what you need to achieve over your DomU, it almost > > certainly possible to be done from Dom0. > > > > It's worth noting that some of the Xen management tools, like > virt-manager (open source Xen) and XenCenter (XenServer/XCP) try to help > you with this process. If you choose to boot one of these from a CD, > the management tool goes out and looks in common locations for a > Xen-based kernel, copies the kernel and initrd over to a temp location, > and boots the VM in PV mode with the CD/DVD attached.This is the "eliloader" tool, it has a pygrub like interface.> This makes the > process transparent to the end user, but it still is not truly booting > off of a CD. Most modern Linux distributions have a Xen kernel and > initrd located somewhere on the install media for just this purpose.There's an example of how to use pygrub for this purpose at http://wiki.xen.org/wiki/Debian_Guest_Installation_Using_Debian_Installer#Create_Initial_Guest_Configuration_2 pygrub actually speaks isolinux so if the kernels referenced by the isolinux config on the CD are xen capable then things might just work... Ian. _______________________________________________ Xen-users mailing list Xen-users@lists.xen.org http://lists.xen.org/xen-users
Jun Hu
2012-Oct-10 22:34 UTC
Re: how to boot a para-virtulized vm from cdrom afterinstallation
You can try this: 1. Hard way. Set up a new, completely new, HVM DomU. Attach your former PV DomU to it and boot form CD. -No, the hvm domu can't boot the pv's xen flavor kernel . 2. Depends on what you need to achieve over your DomU, it almost certainly possible to be done from Dom0. -almost agree with you ,but there is a scene: when I need to do some rescue for the boot disk using cdrom . -----原始邮件----- From: jun hu Sent: Tuesday, October 09, 2012 4:48 AM To: Alexandre Kouznetsov Cc: xen-users@lists.xen.org Subject: Re: [Xen-users] how to boot a para-virtulized vm from cdrom afterinstallation thanks a lot I see you now from hujun's iphone 在 2012-10-9,0:11,"Alexandre Kouznetsov" <alk@ondore.com> 写道:> Hello. > > El 06/10/12 08:38, jun hu escribió: >> how to boot a para-virtulized vm from cdrom after installation? > > In short, it does not work that way. > > When you decide "where to boot from", it implies there is some piece of > code (BIOS, for example) that will look for a bootloader on some device. > This is perfectly valid in HVM mode of operation, but not in PV. > > In case of Para-Virtualized DomU, the hypervisor itself loads the kernel, > specified in the config file. There is no BIOS or bootloader residing in > the MBR of a block device. There is no no such thing as "boot device" or > "boot order". > > You can try this: > 1. Hard way. Set up a new, completely new, HVM DomU. Attach your former PV > DomU to it and boot form CD. > > 2. Depends on what you need to achieve over your DomU, it almost certainly > possible to be done from Dom0. > > Greetings. > > -- > Alexandre Kouznetsov > > > _______________________________________________ > Xen-users mailing list > Xen-users@lists.xen.org > http://lists.xen.org/xen-users_______________________________________________ Xen-users mailing list Xen-users@lists.xen.org http://lists.xen.org/xen-users _______________________________________________ Xen-users mailing list Xen-users@lists.xen.org http://lists.xen.org/xen-users
Alexandre Kouznetsov
2012-Oct-10 23:02 UTC
Re: how to boot a para-virtulized vm from cdrom afterinstallation
Hello. El 10/10/12 17:34, Jun Hu escribió:> You can try this: >> 1. Hard way. Set up a new, completely new, HVM DomU. Attach your former >> PV DomU to it and boot form CD. > -No, the hvm domu can't boot the pv's xen flavor kernel .That is correct, HVM can't boot a PV kernel. But in this scenario you are not booting a PV kernel. Instead, you would be booting a regular kernel from your CD. That's why you need to switch to HVM, you boot CD unlikely would provide a PV enabled kernel. You can extract the kernel and initrd from CD, make Xen use them for booting, but this will have little to do with "Booting from CD". The words "Boot custom kernel" will describe that much better, and it's documented elsewhere. By the way, since kernel 3.something, the same kernel image can be used to boot PV and HVM machine. But that is probably not the case, you will have to boot thatever jernel is in your CD, not the one you choose.>> 2. Depends on what you need to achieve over your DomU, it almost >> certainly possible to be done from Dom0. > -almost agree with you ,but there is a scene: > > when I need to do some rescue for the boot disk using cdrom .I'm afraid, the term "rescue" turns ambiguous when we talk about a virtual machine. Please consider, in what cases you would need to "rescue" a guest system? 1. Test a new system, tool, new fancy LiveCD. Don't use your existing VM, make a new one. Shutdown the existing one, if you are short of resources. 2. Broken boot process. Since PV guest does not use it's own bootloader, there is nothing to be broken (or fixed) from within the DomU on this stage. If the boot loader is broken, it needs to be fixed at Dom0, put your guest machine aside. There also might be something wrong with init scripts, in this case you would shutdown the DomU, mount it's filesystem within Dom0 and make the modifications. No need to boot into the virtual machine from external media. 3. Broken everything, rescue data. Mount DomU's filesystem in Dom0, copy your data. Or even better, make a new VM and attach the old storage to it (it's always a good idea to keep your system and the data on separate volumes). Again, you already have access to your virtual machine's storage, no need to boot from CD. 4. Virus, trojan, rootkit, crime evidence, forensic analysis, etc. Do not mount your VM's filesystem, instead do a binary dump of it's storage to somewhere safe. Same case. That's what I meant when i told you "it does not work that way". -- Alexandre Kouznetsov _______________________________________________ Xen-users mailing list Xen-users@lists.xen.org http://lists.xen.org/xen-users
Jun Hu
2012-Oct-11 01:01 UTC
Re: how to boot a para-virtulized vm from cdromafterinstallation
yes, I propose this problem only for trouble-shooting. your view is overall , thanks a lot. -----原始邮件----- From: Alexandre Kouznetsov Sent: Thursday, October 11, 2012 7:02 AM To: xen-users@lists.xen.org Subject: Re: [Xen-users] how to boot a para-virtulized vm from cdromafterinstallation Hello. El 10/10/12 17:34, Jun Hu escribió:> You can try this: >> 1. Hard way. Set up a new, completely new, HVM DomU. Attach your former >> PV DomU to it and boot form CD. > -No, the hvm domu can't boot the pv's xen flavor kernel .That is correct, HVM can't boot a PV kernel. But in this scenario you are not booting a PV kernel. Instead, you would be booting a regular kernel from your CD. That's why you need to switch to HVM, you boot CD unlikely would provide a PV enabled kernel. You can extract the kernel and initrd from CD, make Xen use them for booting, but this will have little to do with "Booting from CD". The words "Boot custom kernel" will describe that much better, and it's documented elsewhere. By the way, since kernel 3.something, the same kernel image can be used to boot PV and HVM machine. But that is probably not the case, you will have to boot thatever jernel is in your CD, not the one you choose.>> 2. Depends on what you need to achieve over your DomU, it almost >> certainly possible to be done from Dom0. > -almost agree with you ,but there is a scene: > > when I need to do some rescue for the boot disk using cdrom .I'm afraid, the term "rescue" turns ambiguous when we talk about a virtual machine. Please consider, in what cases you would need to "rescue" a guest system? 1. Test a new system, tool, new fancy LiveCD. Don't use your existing VM, make a new one. Shutdown the existing one, if you are short of resources. 2. Broken boot process. Since PV guest does not use it's own bootloader, there is nothing to be broken (or fixed) from within the DomU on this stage. If the boot loader is broken, it needs to be fixed at Dom0, put your guest machine aside. There also might be something wrong with init scripts, in this case you would shutdown the DomU, mount it's filesystem within Dom0 and make the modifications. No need to boot into the virtual machine from external media. 3. Broken everything, rescue data. Mount DomU's filesystem in Dom0, copy your data. Or even better, make a new VM and attach the old storage to it (it's always a good idea to keep your system and the data on separate volumes). Again, you already have access to your virtual machine's storage, no need to boot from CD. 4. Virus, trojan, rootkit, crime evidence, forensic analysis, etc. Do not mount your VM's filesystem, instead do a binary dump of it's storage to somewhere safe. Same case. That's what I meant when i told you "it does not work that way". -- Alexandre Kouznetsov _______________________________________________ Xen-users mailing list Xen-users@lists.xen.org http://lists.xen.org/xen-users _______________________________________________ Xen-users mailing list Xen-users@lists.xen.org http://lists.xen.org/xen-users