Hi I am new to xen . I need to develop one project that will back up virtual machine from host. Is there any "script which will support this" in host. Or any script which is used to list files of virtual machines in the host..........please help me in this regards Waiting for reply Thanking you Namitha _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Hi there, If you google around a bit you may find some backup scripts that people have hacked up... I can''t think of a specific project you''d go to off the top of my head.> I am new to xen . I need to develop one project that will back up > virtual machine from host. Is there any "script which will support this" > in host. Or any script which is used to list files of virtual machines > in the host..........please help me in this regardsYou could parse the config file to figure out what disk files are used by the VM. Or you could use the xenstore-* (e.g. xenstore-ls) commands to read details from Xenstore regarding what the paths of the virtual disks are. Or, more simply, you could just adopt a naming strategy for your domain''s virtual disks based on their config file name / hostname. And then just code your backup scripts to understand that (e.g. domain with "hostname" has config file /etc/xen/hostname and disk /vm-disks/hostname.disk). It''ll be site-specific but if it works for you, that''s what counts. Personally, I just rsync backup the contents of /mnt/vm/, which contains all my VM''s virtual disks (having shut the VMs down first). I also rsync /etc/xen/ to my backup device. This doesn''t record which disk belongs to which VM but it does make it easy to restore the whole lot at once (just rsync them back). If I ever need to restore a particular VM I can do it manually without to much hassle. Actually, I''ve been working on a much more advanced backup script for backing up VMs in a home / smaller deployment environment. I''m waiting on word from my employers regarding whether I can release this publically. For anyone interested, there''s some details at http://www.cl.cam.ac.uk/~maw48/vm-backup-pictures/ - but don''t hold your breath for it to be released because it could take a long while to get permission, if it''s allowed at all. Cheers, Mark -- Dave: Just a question. What use is a unicyle with no seat? And no pedals! Mark: To answer a question with a question: What use is a skateboard? Dave: Skateboards have wheels. Mark: My wheel has a wheel! _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Mark Williamson
2007-Dec-09 02:17 UTC
[Xen-users] multiple dom0s (was: Re: [Xen-devel] ragarding xen in sles10)
Hi Namitha, I hope you don''t mind but I''ve copied my reply onto xen-users for public visibility.> I am trying to create two privileged domains for better performance..... > I have set up XEN on sles10 sp1. Created VMs on that. > > Is it possible to create two domain0''s? If it is possible how can we > make them to manage VMs. > > I tried a lot to get document on such topics...but I failed to get such > document.dom0 is much like a domU but it is special in a number of ways. Two important ways are: 1) can access the real hardware - by default dom0 owns all the real hardware in the system 2) can manage other domains Number 1 can be extended to domUs using the pciback / pcifront drivers. This allows you to dedicate PCI devices to PV domUs. If you want, you can set these domUs to be "backends" for certain devices, so that they export their devices as virtual disks or virtual network interfaces to other domUs, just like dom0 does. Or they can just use the devices themselves to improve performance. Giving a domain this ability means that you are trusting it as much as dom0. A more restricted form of this would be to just dedicate, say, a serial port to a domain. There''s basic support so that HVM domains can be given dedicated access to USB devices. And in the xen-unstable tree it''s now possible to dedicate PCI devices to HVM domUs - and isolate them so they can''t damage the system. Number 2 is currently reserved only for dom0 and there''s no way of allowing another domain to share this function. There are lots of possibilities here, depending on what you''re trying to achieve. Cheers, Mark> > -----Original Message----- > From: M.A. Williamson [mailto:maw48@hermes.cam.ac.uk] On Behalf Of Mark > Williamson > Sent: Monday, 3 December 2007 9:26 AM > To: xen-devel@lists.xensource.com > Cc: P, Namitha > Subject: Re: [Xen-devel] ragarding xen in sles10 > > Hi there, > > If you google around a bit you may find some backup scripts that people > have > hacked up... I can''t think of a specific project you''d go to off the > top of > my head. > > > I am new to xen . I need to develop one project that will back up > > virtual machine from host. Is there any "script which will support > > this" > > > in host. Or any script which is used to list files of virtual machines > > in the host..........please help me in this regards > > You could parse the config file to figure out what disk files are used > by the > VM. Or you could use the xenstore-* (e.g. xenstore-ls) commands to read > > details from Xenstore regarding what the paths of the virtual disks are. > > Or, more simply, you could just adopt a naming strategy for your > domain''s > virtual disks based on their config file name / hostname. And then just > code > your backup scripts to understand that (e.g. domain with "hostname" has > config file /etc/xen/hostname and disk /vm-disks/hostname.disk). It''ll > be > site-specific but if it works for you, that''s what counts. > > Personally, I just rsync backup the contents of /mnt/vm/, which contains > all > my VM''s virtual disks (having shut the VMs down first). I also > rsync /etc/xen/ to my backup device. This doesn''t record which disk > belongs > to which VM but it does make it easy to restore the whole lot at once > (just > rsync them back). If I ever need to restore a particular VM I can do it > > manually without to much hassle. > > Actually, I''ve been working on a much more advanced backup script for > backing > up VMs in a home / smaller deployment environment. I''m waiting on word > from > my employers regarding whether I can release this publically. For > anyone > interested, there''s some details at > http://www.cl.cam.ac.uk/~maw48/vm-backup-pictures/ - but don''t hold your > > breath for it to be released because it could take a long while to get > permission, if it''s allowed at all. > > Cheers, > Mark-- Dave: Just a question. What use is a unicyle with no seat? And no pedals! Mark: To answer a question with a question: What use is a skateboard? Dave: Skateboards have wheels. Mark: My wheel has a wheel! _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Mark Williamson
2007-Dec-10 01:59 UTC
Re: [Xen-users] multiple dom0s (was: Re: [Xen-devel] ragarding xen in sles10)
> I loaded pciback module using modprobe and tried to unbind a pci device > (IDE controller with pci id --00:1f.1) from PIIX_IDE and bind it to > pciback. But it is giving error " write error: no such device".Please remember that you shouldn''t try and do this with a device you need to use in dom0. You can only do it with "spare" devices that dom0 doesn''t need to use in order to run (e.g. the IDE controller with dom0''s disk attached can''t be passed through). Whilst you''re playing around with PCI device assignment you would ideally use a testing machine that you don''t care about, in case you get something wrong. Don''t learn this stuff on an important machine if you can help it! If you want to pass a device through you need to make sure that a normal driver in domain 0 does not grab it, otherwise pciback won''t be able to seize it. This is quite a common problem, since the hotplug routines are very good at loading the "real" device driver automatically, which is usually what you want - but not in this case! To make sure pciback does get the device you can do one of the following: a) follow the instructions in section 1.ii at http://wiki.xensource.com/xenwiki/Assign_hardware_to_DomU_with_PCIBack_as_module to manually unbind the device from the current driver and rebind to pciback b) use the instructions in section 2 at the wiki page to modify modprobe.conf to make sure that pciback gets a chance to grab the device before the normal driver for that device does c) compile pciback statically into the kernel and then put a pciback.hide directive onto your kernel command line and reboot I''d start off with a). Using the instructions on the wiki page you can manually unbind the device from whatever its current driver is. In this particular case I think the following command should do that for you: echo -n "0000:00:1f.1" > "/sys/bus/pci/devices/0000:00:1f.1/driver/unbind" That command is just a shorthand for what the instructions on the wiki do. Then issue your other commands again:> I am using following command to bind the device.... > > echo -n 0000:00:1f.1 > /sys/bus/pci/drivers/pciback/new_slot > echo -n 0000:00:1f.1 > /sys/bus/pci/drivers/pciback/bindand see if this works better. Cheers, Mark> Why it is giving such error? > > Thanks and regards > Namitha > > -----Original Message----- > From: M.A. Williamson [mailto:maw48@hermes.cam.ac.uk] On Behalf Of Mark > Williamson > Sent: Sunday, 9 December 2007 7:48 AM > To: P, Namitha > Cc: xen-users@lists.xensource.com > Subject: [Xen-users] multiple dom0s (was: Re: [Xen-devel] ragarding xen > in sles10) > > Hi Namitha, > > I hope you don''t mind but I''ve copied my reply onto xen-users for public > > visibility. > > > I am trying to create two privileged domains for better > > performance..... > > > I have set up XEN on sles10 sp1. Created VMs on that. > > > > Is it possible to create two domain0''s? If it is possible how can we > > make them to manage VMs. > > > > I tried a lot to get document on such topics...but I failed to get > > such > > > document. > > dom0 is much like a domU but it is special in a number of ways. Two > important > ways are: > > 1) can access the real hardware - by default dom0 owns all the real > hardware > in the system > 2) can manage other domains > > Number 1 can be extended to domUs using the pciback / pcifront drivers. > This > allows you to dedicate PCI devices to PV domUs. If you want, you can > set > these domUs to be "backends" for certain devices, so that they export > their > devices as virtual disks or virtual network interfaces to other domUs, > just > like dom0 does. Or they can just use the devices themselves to improve > performance. Giving a domain this ability means that you are trusting > it as > much as dom0. > > A more restricted form of this would be to just dedicate, say, a serial > port > to a domain. There''s basic support so that HVM domains can be given > dedicated access to USB devices. And in the xen-unstable tree it''s now > possible to dedicate PCI devices to HVM domUs - and isolate them so they > > can''t damage the system. > > Number 2 is currently reserved only for dom0 and there''s no way of > allowing > another domain to share this function. > > There are lots of possibilities here, depending on what you''re trying to > > achieve. > > Cheers, > Mark > > > -----Original Message----- > > From: M.A. Williamson [mailto:maw48@hermes.cam.ac.uk] On Behalf Of > > Mark > > > Williamson > > Sent: Monday, 3 December 2007 9:26 AM > > To: xen-devel@lists.xensource.com > > Cc: P, Namitha > > Subject: Re: [Xen-devel] ragarding xen in sles10 > > > > Hi there, > > > > If you google around a bit you may find some backup scripts that > > people > > > have > > hacked up... I can''t think of a specific project you''d go to off the > > top of > > my head. > > > > > I am new to xen . I need to develop one project that will back up > > > virtual machine from host. Is there any "script which will support > > > > this" > > > > > in host. Or any script which is used to list files of virtual > > machines > > > > in the host..........please help me in this regards > > > > You could parse the config file to figure out what disk files are used > > by the > > VM. Or you could use the xenstore-* (e.g. xenstore-ls) commands to > > read > > > details from Xenstore regarding what the paths of the virtual disks > > are. > > > Or, more simply, you could just adopt a naming strategy for your > > domain''s > > virtual disks based on their config file name / hostname. And then > > just > > > code > > your backup scripts to understand that (e.g. domain with "hostname" > > has > > > config file /etc/xen/hostname and disk /vm-disks/hostname.disk). > > It''ll > > > be > > site-specific but if it works for you, that''s what counts. > > > > Personally, I just rsync backup the contents of /mnt/vm/, which > > contains > > > all > > my VM''s virtual disks (having shut the VMs down first). I also > > rsync /etc/xen/ to my backup device. This doesn''t record which disk > > belongs > > to which VM but it does make it easy to restore the whole lot at once > > (just > > rsync them back). If I ever need to restore a particular VM I can do > > it > > > manually without to much hassle. > > > > Actually, I''ve been working on a much more advanced backup script for > > backing > > up VMs in a home / smaller deployment environment. I''m waiting on > > word > > > from > > my employers regarding whether I can release this publically. For > > anyone > > interested, there''s some details at > > http://www.cl.cam.ac.uk/~maw48/vm-backup-pictures/ - but don''t hold > > your > > > breath for it to be released because it could take a long while to get > > permission, if it''s allowed at all. > > > > Cheers, > > Mark-- Dave: Just a question. What use is a unicyle with no seat? And no pedals! Mark: To answer a question with a question: What use is a skateboard? Dave: Skateboards have wheels. Mark: My wheel has a wheel! _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Hi Mark, I agree with your definition for dom0 (" dom0 is much like a domU but it is special in a number of ways ...") But, there is an alternative way , you can use a domU as an "halted" dom0, and when your dom0 crashed you can boot your system with domU as a dom0 (and your dom0 as a domU). I have a domU system (based on LVM partition) so I changed my menu.lst file (grub.conf) to : title 2.6.18-xen31 root (hd0,0) kernel /xen-3.1.0.gz dom0_mem=256M #module /vmlinuz-2.6.18-xen ro root=/dev/VolGroup00/LogVol00 selinux=0 #module /initrd-2.6.18-xen.img module /vmlinuz-2.6.18-xen ro root=/dev/VolGroup00/LogVol02 selinux=0 module /initrd-2.6.18-xen.img (LogVol00 is my root file system for the original dom0 and LogVol2 is the domU root file system) a better way to do it is something like: title 2.6.18-xen31 root (hd0,0) kernel /xen-3.1.0.gz dom0_mem=256M module /vmlinuz-2.6.18-xen ro root=/dev/VolGroup00/LogVol00 selinux=0 module /initrd-2.6.18-xen.img title 2 (alternative system) kernel / xen-3.10.gz ..... module /vmlinuz-2.6.18-xen ro root=/dev/VolGroup00/LogVol02 selinux=0 module /initrd-2.6.18-xen.img (and, of course you need to install xend in your domU ) In regular my domU serving as a domU system but, when I have a problem in my dom0, I can reboot my system and use my domU as a "rescue" environment or alternative dom0 system . I don''t know if its stable enough ... I just tried it in the first time. Any comments ? - Doron Mark Williamson wrote:>> I loaded pciback module using modprobe and tried to unbind a pci device >> (IDE controller with pci id --00:1f.1) from PIIX_IDE and bind it to >> pciback. But it is giving error " write error: no such device". >> > > Please remember that you shouldn''t try and do this with a device you need to > use in dom0. You can only do it with "spare" devices that dom0 doesn''t need > to use in order to run (e.g. the IDE controller with dom0''s disk attached > can''t be passed through). Whilst you''re playing around with PCI device > assignment you would ideally use a testing machine that you don''t care about, > in case you get something wrong. Don''t learn this stuff on an important > machine if you can help it! > > If you want to pass a device through you need to make sure that a normal > driver in domain 0 does not grab it, otherwise pciback won''t be able to seize > it. This is quite a common problem, since the hotplug routines are very good > at loading the "real" device driver automatically, which is usually what you > want - but not in this case! > > To make sure pciback does get the device you can do one of the following: > > a) follow the instructions in section 1.ii at > http://wiki.xensource.com/xenwiki/Assign_hardware_to_DomU_with_PCIBack_as_module > to manually unbind the device from the current driver and rebind to pciback > b) use the instructions in section 2 at the wiki page to modify modprobe.conf > to make sure that pciback gets a chance to grab the device before the normal > driver for that device does > c) compile pciback statically into the kernel and then put a pciback.hide > directive onto your kernel command line and reboot > > I''d start off with a). Using the instructions on the wiki page you can > manually unbind the device from whatever its current driver is. In this > particular case I think the following command should do that for you: > > echo -n "0000:00:1f.1" > "/sys/bus/pci/devices/0000:00:1f.1/driver/unbind" > > That command is just a shorthand for what the instructions on the wiki do. > > Then issue your other commands again: > > >> I am using following command to bind the device.... >> >> echo -n 0000:00:1f.1 > /sys/bus/pci/drivers/pciback/new_slot >> echo -n 0000:00:1f.1 > /sys/bus/pci/drivers/pciback/bind >> > > and see if this works better. > > Cheers, > Mark > > >> Why it is giving such error? >> >> Thanks and regards >> Namitha >> >> -----Original Message----- >> From: M.A. Williamson [mailto:maw48@hermes.cam.ac.uk] On Behalf Of Mark >> Williamson >> Sent: Sunday, 9 December 2007 7:48 AM >> To: P, Namitha >> Cc: xen-users@lists.xensource.com >> Subject: [Xen-users] multiple dom0s (was: Re: [Xen-devel] ragarding xen >> in sles10) >> >> Hi Namitha, >> >> I hope you don''t mind but I''ve copied my reply onto xen-users for public >> >> visibility. >> >> >>> I am trying to create two privileged domains for better >>> >> performance..... >> >> >>> I have set up XEN on sles10 sp1. Created VMs on that. >>> >>> Is it possible to create two domain0''s? If it is possible how can we >>> make them to manage VMs. >>> >>> I tried a lot to get document on such topics...but I failed to get >>> >> such >> >> >>> document. >>> >> dom0 is much like a domU but it is special in a number of ways. Two >> important >> ways are: >> >> 1) can access the real hardware - by default dom0 owns all the real >> hardware >> in the system >> 2) can manage other domains >> >> Number 1 can be extended to domUs using the pciback / pcifront drivers. >> This >> allows you to dedicate PCI devices to PV domUs. If you want, you can >> set >> these domUs to be "backends" for certain devices, so that they export >> their >> devices as virtual disks or virtual network interfaces to other domUs, >> just >> like dom0 does. Or they can just use the devices themselves to improve >> performance. Giving a domain this ability means that you are trusting >> it as >> much as dom0. >> >> A more restricted form of this would be to just dedicate, say, a serial >> port >> to a domain. There''s basic support so that HVM domains can be given >> dedicated access to USB devices. And in the xen-unstable tree it''s now >> possible to dedicate PCI devices to HVM domUs - and isolate them so they >> >> can''t damage the system. >> >> Number 2 is currently reserved only for dom0 and there''s no way of >> allowing >> another domain to share this function. >> >> There are lots of possibilities here, depending on what you''re trying to >> >> achieve. >> >> Cheers, >> Mark >> >> >>> -----Original Message----- >>> From: M.A. Williamson [mailto:maw48@hermes.cam.ac.uk] On Behalf Of >>> >> Mark >> >> >>> Williamson >>> Sent: Monday, 3 December 2007 9:26 AM >>> To: xen-devel@lists.xensource.com >>> Cc: P, Namitha >>> Subject: Re: [Xen-devel] ragarding xen in sles10 >>> >>> Hi there, >>> >>> If you google around a bit you may find some backup scripts that >>> >> people >> >> >>> have >>> hacked up... I can''t think of a specific project you''d go to off the >>> top of >>> my head. >>> >>> >>>> I am new to xen . I need to develop one project that will back up >>>> virtual machine from host. Is there any "script which will support >>>> >>> this" >>> >>> >>>> in host. Or any script which is used to list files of virtual >>>> >> machines >> >> >>>> in the host..........please help me in this regards >>>> >>> You could parse the config file to figure out what disk files are used >>> by the >>> VM. Or you could use the xenstore-* (e.g. xenstore-ls) commands to >>> >> read >> >> >>> details from Xenstore regarding what the paths of the virtual disks >>> >> are. >> >> >>> Or, more simply, you could just adopt a naming strategy for your >>> domain''s >>> virtual disks based on their config file name / hostname. And then >>> >> just >> >> >>> code >>> your backup scripts to understand that (e.g. domain with "hostname" >>> >> has >> >> >>> config file /etc/xen/hostname and disk /vm-disks/hostname.disk). >>> >> It''ll >> >> >>> be >>> site-specific but if it works for you, that''s what counts. >>> >>> Personally, I just rsync backup the contents of /mnt/vm/, which >>> >> contains >> >> >>> all >>> my VM''s virtual disks (having shut the VMs down first). I also >>> rsync /etc/xen/ to my backup device. This doesn''t record which disk >>> belongs >>> to which VM but it does make it easy to restore the whole lot at once >>> (just >>> rsync them back). If I ever need to restore a particular VM I can do >>> >> it >> >> >>> manually without to much hassle. >>> >>> Actually, I''ve been working on a much more advanced backup script for >>> backing >>> up VMs in a home / smaller deployment environment. I''m waiting on >>> >> word >> >> >>> from >>> my employers regarding whether I can release this publically. For >>> anyone >>> interested, there''s some details at >>> http://www.cl.cam.ac.uk/~maw48/vm-backup-pictures/ - but don''t hold >>> >> your >> >> >>> breath for it to be released because it could take a long while to get >>> permission, if it''s allowed at all. >>> >>> Cheers, >>> Mark >>> > > > >_______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
jim burns
2007-Dec-25 16:00 UTC
Re: [Xen-users] multiple dom0s (was: Re: [Xen-devel] ragarding xen in sles10)
On Sun December 9 2007 8:59:02 pm Mark Williamson wrote:> c) compile pciback statically into the kernel and then put a pciback.hide > directive onto your kernel command line and rebootCONFIG_XEN_BACKEND=y CONFIG_XEN_BLKDEV_BACKEND=m CONFIG_XEN_NETDEV_BACKEND=m CONFIG_XEN_PCIDEV_BACKEND=m CONFIG_XEN_PCIDEV_BACKEND_VPCI=y I have the above in my fedora xen kernel. Is that sufficient. (BTW, SuSE has the first line as ''m'' also.) _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Mark Williamson
2007-Dec-26 14:58 UTC
Re: [Xen-users] multiple dom0s (was: Re: [Xen-devel] ragarding xen in sles10)
> On Sun December 9 2007 8:59:02 pm Mark Williamson wrote: > > c) compile pciback statically into the kernel and then put a pciback.hide > > directive onto your kernel command line and reboot > > CONFIG_XEN_BACKEND=y > CONFIG_XEN_BLKDEV_BACKEND=m > CONFIG_XEN_NETDEV_BACKEND=m > CONFIG_XEN_PCIDEV_BACKEND=m > CONFIG_XEN_PCIDEV_BACKEND_VPCI=y > > I have the above in my fedora xen kernel. Is that sufficient. (BTW, SuSE > has the first line as ''m'' also.)This means that the PCI backend is built as a module (the additional XEN_PCIDEV_BACKEND_VPCI=y is just configuring an option, not building something statically into the kernel). You can still use PCI passthrough like that, but just putting pciback.hide on your kernel command line won''t work - you''d need to pass them to the module at load time. Whatsmore, you need to make sure that pciback is able to claim those devices, which is only possible if they''re not bound to another driver. So either you need to make sure pciback is loaded before other drivers for the hardware, or you need to unbind the hardware from whatever driver has grabbed it and then rebind it to pciback. There are some instructions at: http://wiki.xensource.com/xenwiki/Assign_hardware_to_DomU_with_PCIBack_as_module which may help you. I''ve not actually tested them myself but last time I looked through them they looked fairly sane. You ought to make sure you''re familiar with the drawbacks and limitations of PCI passthrough before deploying it in production, as there are a few fairly significant caveats (e.g. that the domain with PCI hardware is effectively as privileged as dom0, since it can probably abuse that hardware to take over the machine if it acts maliciously). VT-d will probably help mitigate some of these limitations eventually - support for VT-d with HVM domains is already in xen-unstable, but not for PV yet, I think. Cheers, Mark -- Dave: Just a question. What use is a unicyle with no seat? And no pedals! Mark: To answer a question with a question: What use is a skateboard? Dave: Skateboards have wheels. Mark: My wheel has a wheel! _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users