Hi, I''m a xen newbie and i try to configure xen (lenny), - Dom0 Boot On San (lenny 5.0.3 amd64) - DomU LV on clvm (openais) LM08q:/var/vm/scripts# xm list Name ID Mem VCPUs State Time(s) Domain-0 0 1024 8 r----- 665.0 xen-dmz-vm02 256 1 0.0 xen-int-vm01 1 256 1 -b---- 7.4 xen-wif-vm03 256 1 0.0 LM09q:/etc/xen# xm list Name ID Mem VCPUs State Time(s) Domain-0 0 1024 8 r----- 1310.3 xen-dmz-vm02 1 256 1 -b---- 283.3 xen-int-vm01 256 1 0.0 xen-wif-vm03 3 256 1 -b---- 2.0 if i try to ''xm create xen-int-vm01.cfg'' on LM09q i get this error : xm create xen-int-vm01.cfg Using config file "./xen-int-vm01.cfg". Error: VM name ''xen-int-vm01'' already exists This is a good behavior i think. But, with virt-manager i can start xen-int-vm01 on LM09q so thereis 2 instances of the DomU sharing the same LV !!! Is there something wrong in my config ? How can i avoid this ? Thank you. -- Guy _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Fajar A. Nugraha
2010-Mar-24 03:12 UTC
Re: [Xen-users] 2 instances of a DomU on the same LV
On Mon, Mar 22, 2010 at 11:20 PM, Guy Roussin <guy.roussin@teledetection.fr> wrote:> Hi, > > I''m a xen newbie and i try to configure xen (lenny), > > - Dom0 Boot On San (lenny 5.0.3 amd64) > - DomU LV on clvm (openais) > > LM08q:/var/vm/scripts# xm list > Name ID Mem VCPUs State > Time(s) > Domain-0 0 1024 8 r----- > 665.0 > xen-dmz-vm02 256 1 > 0.0 > xen-int-vm01 1 256 1 -b---- > 7.4 > xen-wif-vm03 256 1 > 0.0 > > LM09q:/etc/xen# xm list > Name ID Mem VCPUs State > Time(s) > Domain-0 0 1024 8 r----- > 1310.3 > xen-dmz-vm02 1 256 1 -b---- > 283.3 > xen-int-vm01 256 1 > 0.0 > xen-wif-vm03 3 256 1 -b---- > 2.0 > > if i try to ''xm create xen-int-vm01.cfg'' on LM09q i get this error : > xm create xen-int-vm01.cfg > Using config file "./xen-int-vm01.cfg". > Error: VM name ''xen-int-vm01'' already exists > > This is a good behavior i think. > > But, with virt-manager i can start xen-int-vm01 on LM09q > so thereis 2 instances of the DomU sharing the same LV !!!You misunderstood the commands. First the basics: xen does a basic sanity check to prevent more than a domU uses the same block device/file when it''s set as writable, unless user specifically overides it. The check is only on the same dom0. Nothing is done to prevent the same device used on another dom0. You need some other kind of external mechanism to prevent that. Your original "xm create" command failed because the domU is already defined, but not started. You can start it with "xm start", which would produce the same result as starting it from virt-manager. -- Fajar _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Hi,>> if i try to ''xm create xen-int-vm01.cfg'' on LM09q i get this error : >> xm create xen-int-vm01.cfg >> Using config file "./xen-int-vm01.cfg". >> Error: VM name ''xen-int-vm01'' already exists >> ... >> But, with virt-manager i can start xen-int-vm01 on LM09q >> so thereis 2 instances of the DomU sharing the same LV !!! >> > > You misunderstood the commands. > > First the basics: xen does a basic sanity check to prevent more than a > domU uses the same block device/file when it''s set as writable, unless > user specifically overides it. The check is only on the same dom0. > Nothing is done to prevent the same device used on another dom0. You > need some other kind of external mechanism to prevent that. > > Your original "xm create" command failed because the domU is already > defined, but not started. You can start it with "xm start", which > would produce the same result as starting it from virt-managerThank you Fajar, now i understand the logic. Is there some "external mechanism" i can use ? Otherwise I could develop my own simple mechanisms (shell scripts), and stop using virt-manager. Thank you, Guy _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Fajar A. Nugraha
2010-Mar-24 09:41 UTC
Re: [Xen-users] 2 instances of a DomU on the same LV
On Wed, Mar 24, 2010 at 4:23 PM, Guy Roussin <guy.roussin@teledetection.fr> wrote:>> First the basics: xen does a basic sanity check to prevent more than a >> domU uses the same block device/file when it''s set as writable, unless >> user specifically overides it. The check is only on the same dom0. >> Nothing is done to prevent the same device used on another dom0. You >> need some other kind of external mechanism to prevent that.> Thank you Fajar, now i understand the logic. > Is there some "external mechanism" i can use ?No ready-to-use script/application that I know of.> Otherwise I could develop my own simple mechanisms (shell scripts),You could extend /etc/xen/scripts/block. Look for check_sharing(), and add a custom function there to check whether a remote node/guest is using it. A simple way would be to set up ssh authorized_keys on both nodes and changing the basic commands (cat /proc/mounts, xenstore-list/read) to have "ssh other-host-ip" in front of it. I''m not sure how this method will interact with live migration though.> and stop using virt-manager.If done correctly, you can still use virt-manager. -- Fajar _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
>> Otherwise I could develop my own simple mechanisms (shell scripts), >> > > You could extend /etc/xen/scripts/block. Look for check_sharing(), and > add a custom function there to check whether a remote node/guest is > using it. > > A simple way would be to set up ssh authorized_keys on both nodes and > changing the basic commands (cat /proc/mounts, xenstore-list/read) to > have "ssh other-host-ip" in front of it. I''m not sure how this method > will interact with live migration though. >Thank you I''ll try to do that, without breaking live migration. Guy _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Le -10/01/-28163 20:59, Fajar A. Nugraha a écrit :> On Wed, Mar 24, 2010 at 4:23 PM, Guy Roussin > <guy.roussin@teledetection.fr> wrote: > >>> First the basics: xen does a basic sanity check to prevent more than a >>> domU uses the same block device/file when it''s set as writable, unless >>> user specifically overides it. The check is only on the same dom0. >>> Nothing is done to prevent the same device used on another dom0. You >>> need some other kind of external mechanism to prevent that. >>> > >> Thank you Fajar, now i understand the logic. >> Is there some "external mechanism" i can use ? >> > No ready-to-use script/application that I know of. > > >> Otherwise I could develop my own simple mechanisms (shell scripts), >> > You could extend /etc/xen/scripts/block. Look for check_sharing(), and > add a custom function there to check whether a remote node/guest is > using it. > > A simple way would be to set up ssh authorized_keys on both nodes and > changing the basic commands (cat /proc/mounts, xenstore-list/read) to > have "ssh other-host-ip" in front of it. I''m not sure how this method > will interact with live migration though. > > >> and stop using virt-manager. >> > If done correctly, you can still use virt-manager. > >Hello, Sorry for bring back this thread but, like Fajar said, i extended the "/etc/xen/scripts/block" script. Now, on the add of a new device, we check that this device is an LV and if it is not already opened on another node of our non-clustered dom0s which access to the shared VG. Problem is that this script is called by udevd when a device is added or removed, but in the case of migration, this will not works. # cat /etc/udev/xen-backend.rules | grep block SUBSYSTEM=="xen-backend", KERNEL=="vbd*", RUN+="/etc/xen/scripts/block $env{ACTION}" So how does the node could know that the device is ''mounted'' by xen for a migration, and how udev could handle this and does the appropriate call to the block script ? Best regards, -- Matthew