Teck Choon Giam
2012-Feb-09 17:12 UTC
xen-4.1.3-rc1-pre changeset 23224:cccd6c68e1b9 hvm xl not execute vif-bridge when xl destroy hvmdomain or xl trigger hvmdomain power
Hi, I need to check whether is this intended? When using xl create hvm domains, it does execute vif-bridge script. However, when doing xl destroy or xl trigger hvmdomain power it doesn''t execute vif-bridge script. I just did the following to test: # cp -pvf /etc/xen/scripts/vif-bridge /etc/xen/scripts/vif-bridge.orig # cat > /etc/xen/scripts/vif-bridge <<''EOF'' #!/bin/bash echo "$@" >> vif-bridge.log /etc/xen/scripts/vif-bridge.orig "$@" EOF When using xm and xl to create hvmdomain, I can see vif-bridge.log appended with: online type_if=vif online type_if=vif add type_if=tap add type_if=tap Since I have allocated 2 vifs (one for WAN and one for LAN)... so it gets to execute vif-bridge once for each vif which looks right. Now the problem is xl trigger hvmdomain power and xl destroy power. Both never call vif-bridge script as there isn''t any such line like: offline type_if=vif offline type_if=vif Whereby when I tried with xm trigger hvmdomain power, it does call vif-bridge script as the above two lines get logged. This will leave the iptables FORWARD rule intact when using xl which I reported before :( See http://www.gossamer-threads.com/lists/xen/devel/204990 Thanks. Kindest regards, Giam Teck Choon
Stefano Stabellini
2012-Feb-10 10:45 UTC
Re: xen-4.1.3-rc1-pre changeset 23224:cccd6c68e1b9 hvm xl not execute vif-bridge when xl destroy hvmdomain or xl trigger hvmdomain power
On Thu, 9 Feb 2012, Teck Choon Giam wrote:> Hi, > > I need to check whether is this intended? When using xl create hvm > domains, it does execute vif-bridge script. However, when doing xl > destroy or xl trigger hvmdomain power it doesn''t execute vif-bridge > script. I just did the following to test: > > # cp -pvf /etc/xen/scripts/vif-bridge /etc/xen/scripts/vif-bridge.orig > # cat > /etc/xen/scripts/vif-bridge <<''EOF'' > #!/bin/bash > echo "$@" >> vif-bridge.log > /etc/xen/scripts/vif-bridge.orig "$@" > EOF > > When using xm and xl to create hvmdomain, I can see vif-bridge.log > appended with: > > online type_if=vif > online type_if=vif > add type_if=tap > add type_if=tap > > Since I have allocated 2 vifs (one for WAN and one for LAN)... so it > gets to execute vif-bridge once for each vif which looks right. > > Now the problem is xl trigger hvmdomain power and xl destroy power. > Both never call vif-bridge script as there isn''t any such line like: > > offline type_if=vif > offline type_if=vif > > Whereby when I tried with xm trigger hvmdomain power, it does call > vif-bridge script as the above two lines get logged. > > This will leave the iptables FORWARD rule intact when using xl which I > reported before :( > > See http://www.gossamer-threads.com/lists/xen/devel/204990Actually I have just run the same test but I didn''t see any issues: vif-bridge gets called correctly when the domain dies. It is difficult to tell what is going wrong in your case because vif-bridge is not called directly by XL (or Xend), it is called by vif-setup, that is called by udev when the vif network interface is destroyed. I suggest you check that your udev scripts are correct (/etc/udev/rules.d/xen-backend.rules).
Teck Choon Giam
2012-Feb-10 16:04 UTC
Re: xen-4.1.3-rc1-pre changeset 23224:cccd6c68e1b9 hvm xl not execute vif-bridge when xl destroy hvmdomain or xl trigger hvmdomain power
Hi Stefano, On Fri, Feb 10, 2012 at 6:45 PM, Stefano Stabellini <stefano.stabellini@eu.citrix.com> wrote:> On Thu, 9 Feb 2012, Teck Choon Giam wrote: >> Hi, >> >> I need to check whether is this intended? When using xl create hvm >> domains, it does execute vif-bridge script. However, when doing xl >> destroy or xl trigger hvmdomain power it doesn''t execute vif-bridge >> script. I just did the following to test: >> >> # cp -pvf /etc/xen/scripts/vif-bridge /etc/xen/scripts/vif-bridge.orig >> # cat > /etc/xen/scripts/vif-bridge <<''EOF'' >> #!/bin/bash >> echo "$@" >> vif-bridge.log >> /etc/xen/scripts/vif-bridge.orig "$@" >> EOF >> >> When using xm and xl to create hvmdomain, I can see vif-bridge.log >> appended with: >> >> online type_if=vif >> online type_if=vif >> add type_if=tap >> add type_if=tap >> >> Since I have allocated 2 vifs (one for WAN and one for LAN)... so it >> gets to execute vif-bridge once for each vif which looks right. >> >> Now the problem is xl trigger hvmdomain power and xl destroy power. >> Both never call vif-bridge script as there isn''t any such line like: >> >> offline type_if=vif >> offline type_if=vif >> >> Whereby when I tried with xm trigger hvmdomain power, it does call >> vif-bridge script as the above two lines get logged. >> >> This will leave the iptables FORWARD rule intact when using xl which I >> reported before :( >> >> See http://www.gossamer-threads.com/lists/xen/devel/204990 > > Actually I have just run the same test but I didn''t see any issues: > vif-bridge gets called correctly when the domain dies. > > It is difficult to tell what is going wrong in your case because > vif-bridge is not called directly by XL (or Xend), it is called by > vif-setup, that is called by udev when the vif network interface is > destroyed. > I suggest you check that your udev scripts are correct > (/etc/udev/rules.d/xen-backend.rules).Here is the content of the rules: # cat /etc/udev/rules.d/xen-backend.rules SUBSYSTEM=="xen-backend", KERNEL=="tap*", RUN+="/etc/xen/scripts/blktap $env{ACTION}" SUBSYSTEM=="xen-backend", KERNEL=="vbd*", RUN+="/etc/xen/scripts/block $env{ACTION}" SUBSYSTEM=="xen-backend", KERNEL=="vtpm*", RUN+="/etc/xen/scripts/vtpm $env{ACTION}" SUBSYSTEM=="xen-backend", KERNEL=="vif2-*", RUN+="/etc/xen/scripts/vif2 $env{ACTION}" SUBSYSTEM=="xen-backend", KERNEL=="vif-*", ACTION=="online", RUN+="/etc/xen/scripts/vif-setup online type_if=vif" SUBSYSTEM=="xen-backend", KERNEL=="vif-*", ACTION=="offline", RUN+="/etc/xen/scripts/vif-setup offline type_if=vif" SUBSYSTEM=="xen-backend", KERNEL=="vscsi*", RUN+="/etc/xen/scripts/vscsi $env{ACTION}" SUBSYSTEM=="xen-backend", ACTION=="remove", RUN+="/etc/xen/scripts/xen-hotplug-cleanup" KERNEL=="evtchn", NAME="xen/%k" SUBSYSTEM=="xen", KERNEL=="blktap[0-9]*", NAME="xen/%k", MODE="0600" SUBSYSTEM=="blktap2", KERNEL=="blktap[0-9]*", NAME="xen/blktap-2/%k", MODE="0600" KERNEL=="blktap-control", NAME="xen/blktap-2/control", MODE="0600" KERNEL=="gntdev", NAME="xen/%k", MODE="0600" KERNEL=="pci_iomul", NAME="xen/%k", MODE="0600" KERNEL=="tapdev[a-z]*", NAME="xen/blktap-2/tapdev%m", MODE="0600" SUBSYSTEM=="net", KERNEL=="tap*", ACTION=="add", RUN+="/etc/xen/scripts/vif-setup $env{ACTION} type_if=tap" I guess the responsible lines are: SUBSYSTEM=="xen-backend", KERNEL=="vif-*", ACTION=="online", RUN+="/etc/xen/scripts/vif-setup online type_if=vif" SUBSYSTEM=="xen-backend", KERNEL=="vif-*", ACTION=="offline", RUN+="/etc/xen/scripts/vif-setup offline type_if=vif" So this is my testing: # cp -pvf /etc/xen/scripts/vif-setup /etc/xen/scripts/vif-setup.orig # cat > /etc/xen/scripts/vif-setup <<''EOF'' #!/bin/bash echo "$@" >> $0.log /etc/xen/scripts/vif-setup.orig "$@" EOF Now my testing purely on xm/xl trigger hvmdomain power. Online/Offline get called using xm but xl wise is Online get called but not Offline with hvm domains like windows XP/server 2008r2... any idea what else can make this behaviour difference between xl/xm? The /etc/xen/scripts/vif-setup.log as below. The below is using xl create hvmdomain and get logged: online type_if=vif online type_if=vif add type_if=tap add type_if=tap When using xl trigger hvmdomain power... no log entry at all. Now test with xm create hvmdonain and get logged: online type_if=vif online type_if=vif add type_if=tap add type_if=tap Now test with xm trigger hvmdomain power and get logged: offline type_if=vif offline type_if=vif Thanks for your kind prompt response to my question. Kindest regards, Giam Teck Choon
Stefano Stabellini
2012-Feb-10 17:16 UTC
Re: xen-4.1.3-rc1-pre changeset 23224:cccd6c68e1b9 hvm xl not execute vif-bridge when xl destroy hvmdomain or xl trigger hvmdomain power
On Fri, 10 Feb 2012, Teck Choon Giam wrote:> Hi Stefano, > > On Fri, Feb 10, 2012 at 6:45 PM, Stefano Stabellini > <stefano.stabellini@eu.citrix.com> wrote: > > On Thu, 9 Feb 2012, Teck Choon Giam wrote: > >> Hi, > >> > >> I need to check whether is this intended? When using xl create hvm > >> domains, it does execute vif-bridge script. However, when doing xl > >> destroy or xl trigger hvmdomain power it doesn''t execute vif-bridge > >> script. I just did the following to test: > >> > >> # cp -pvf /etc/xen/scripts/vif-bridge /etc/xen/scripts/vif-bridge.orig > >> # cat > /etc/xen/scripts/vif-bridge <<''EOF'' > >> #!/bin/bash > >> echo "$@" >> vif-bridge.log > >> /etc/xen/scripts/vif-bridge.orig "$@" > >> EOF > >> > >> When using xm and xl to create hvmdomain, I can see vif-bridge.log > >> appended with: > >> > >> online type_if=vif > >> online type_if=vif > >> add type_if=tap > >> add type_if=tap > >> > >> Since I have allocated 2 vifs (one for WAN and one for LAN)... so it > >> gets to execute vif-bridge once for each vif which looks right. > >> > >> Now the problem is xl trigger hvmdomain power and xl destroy power. > >> Both never call vif-bridge script as there isn''t any such line like: > >> > >> offline type_if=vif > >> offline type_if=vif > >> > >> Whereby when I tried with xm trigger hvmdomain power, it does call > >> vif-bridge script as the above two lines get logged. > >> > >> This will leave the iptables FORWARD rule intact when using xl which I > >> reported before :( > >> > >> See http://www.gossamer-threads.com/lists/xen/devel/204990 > > > > Actually I have just run the same test but I didn''t see any issues: > > vif-bridge gets called correctly when the domain dies. > > > > It is difficult to tell what is going wrong in your case because > > vif-bridge is not called directly by XL (or Xend), it is called by > > vif-setup, that is called by udev when the vif network interface is > > destroyed. > > I suggest you check that your udev scripts are correct > > (/etc/udev/rules.d/xen-backend.rules). > > Here is the content of the rules: > > # cat /etc/udev/rules.d/xen-backend.rules > SUBSYSTEM=="xen-backend", KERNEL=="tap*", > RUN+="/etc/xen/scripts/blktap $env{ACTION}" > SUBSYSTEM=="xen-backend", KERNEL=="vbd*", RUN+="/etc/xen/scripts/block > $env{ACTION}" > SUBSYSTEM=="xen-backend", KERNEL=="vtpm*", RUN+="/etc/xen/scripts/vtpm > $env{ACTION}" > SUBSYSTEM=="xen-backend", KERNEL=="vif2-*", > RUN+="/etc/xen/scripts/vif2 $env{ACTION}" > SUBSYSTEM=="xen-backend", KERNEL=="vif-*", ACTION=="online", > RUN+="/etc/xen/scripts/vif-setup online type_if=vif" > SUBSYSTEM=="xen-backend", KERNEL=="vif-*", ACTION=="offline", > RUN+="/etc/xen/scripts/vif-setup offline type_if=vif" > SUBSYSTEM=="xen-backend", KERNEL=="vscsi*", > RUN+="/etc/xen/scripts/vscsi $env{ACTION}" > SUBSYSTEM=="xen-backend", ACTION=="remove", > RUN+="/etc/xen/scripts/xen-hotplug-cleanup" > KERNEL=="evtchn", NAME="xen/%k" > SUBSYSTEM=="xen", KERNEL=="blktap[0-9]*", NAME="xen/%k", MODE="0600" > SUBSYSTEM=="blktap2", KERNEL=="blktap[0-9]*", NAME="xen/blktap-2/%k", > MODE="0600" > KERNEL=="blktap-control", NAME="xen/blktap-2/control", MODE="0600" > KERNEL=="gntdev", NAME="xen/%k", MODE="0600" > KERNEL=="pci_iomul", NAME="xen/%k", MODE="0600" > KERNEL=="tapdev[a-z]*", NAME="xen/blktap-2/tapdev%m", MODE="0600" > SUBSYSTEM=="net", KERNEL=="tap*", ACTION=="add", > RUN+="/etc/xen/scripts/vif-setup $env{ACTION} type_if=tap" > > I guess the responsible lines are: > > SUBSYSTEM=="xen-backend", KERNEL=="vif-*", ACTION=="online", > RUN+="/etc/xen/scripts/vif-setup online type_if=vif" > SUBSYSTEM=="xen-backend", KERNEL=="vif-*", ACTION=="offline", > RUN+="/etc/xen/scripts/vif-setup offline type_if=vif" > > So this is my testing: > > # cp -pvf /etc/xen/scripts/vif-setup /etc/xen/scripts/vif-setup.orig > # cat > /etc/xen/scripts/vif-setup <<''EOF'' > #!/bin/bash > echo "$@" >> $0.log > /etc/xen/scripts/vif-setup.orig "$@" > EOF > > Now my testing purely on xm/xl trigger hvmdomain power. > > Online/Offline get called using xm but xl wise is Online get called > but not Offline with hvm domains like windows XP/server 2008r2... any > idea what else can make this behaviour difference between xl/xm? > > The /etc/xen/scripts/vif-setup.log as below. > > The below is using xl create hvmdomain and get logged: > online type_if=vif > online type_if=vif > add type_if=tap > add type_if=tap > When using xl trigger hvmdomain power... no log entry at all.Does xl trigger hvmdomain power do anything at all? Is the guest shutting down? --8323329-837351818-1328894209=:7456 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --8323329-837351818-1328894209=:7456--
Teck Choon Giam
2012-Feb-10 17:30 UTC
Re: xen-4.1.3-rc1-pre changeset 23224:cccd6c68e1b9 hvm xl not execute vif-bridge when xl destroy hvmdomain or xl trigger hvmdomain power
On Sat, Feb 11, 2012 at 1:16 AM, Stefano Stabellini <stefano.stabellini@eu.citrix.com> wrote:> On Fri, 10 Feb 2012, Teck Choon Giam wrote: >> Hi Stefano, >> >> On Fri, Feb 10, 2012 at 6:45 PM, Stefano Stabellini >> <stefano.stabellini@eu.citrix.com> wrote: >> > On Thu, 9 Feb 2012, Teck Choon Giam wrote: >> >> Hi, >> >> >> >> I need to check whether is this intended? When using xl create hvm >> >> domains, it does execute vif-bridge script. However, when doing xl >> >> destroy or xl trigger hvmdomain power it doesn''t execute vif-bridge >> >> script. I just did the following to test: >> >> >> >> # cp -pvf /etc/xen/scripts/vif-bridge /etc/xen/scripts/vif-bridge.orig >> >> # cat > /etc/xen/scripts/vif-bridge <<''EOF'' >> >> #!/bin/bash >> >> echo "$@" >> vif-bridge.log >> >> /etc/xen/scripts/vif-bridge.orig "$@" >> >> EOF >> >> >> >> When using xm and xl to create hvmdomain, I can see vif-bridge.log >> >> appended with: >> >> >> >> online type_if=vif >> >> online type_if=vif >> >> add type_if=tap >> >> add type_if=tap >> >> >> >> Since I have allocated 2 vifs (one for WAN and one for LAN)... so it >> >> gets to execute vif-bridge once for each vif which looks right. >> >> >> >> Now the problem is xl trigger hvmdomain power and xl destroy power. >> >> Both never call vif-bridge script as there isn''t any such line like: >> >> >> >> offline type_if=vif >> >> offline type_if=vif >> >> >> >> Whereby when I tried with xm trigger hvmdomain power, it does call >> >> vif-bridge script as the above two lines get logged. >> >> >> >> This will leave the iptables FORWARD rule intact when using xl which I >> >> reported before :( >> >> >> >> See http://www.gossamer-threads.com/lists/xen/devel/204990 >> > >> > Actually I have just run the same test but I didn''t see any issues: >> > vif-bridge gets called correctly when the domain dies. >> > >> > It is difficult to tell what is going wrong in your case because >> > vif-bridge is not called directly by XL (or Xend), it is called by >> > vif-setup, that is called by udev when the vif network interface is >> > destroyed. >> > I suggest you check that your udev scripts are correct >> > (/etc/udev/rules.d/xen-backend.rules). >> >> Here is the content of the rules: >> >> # cat /etc/udev/rules.d/xen-backend.rules >> SUBSYSTEM=="xen-backend", KERNEL=="tap*", >> RUN+="/etc/xen/scripts/blktap $env{ACTION}" >> SUBSYSTEM=="xen-backend", KERNEL=="vbd*", RUN+="/etc/xen/scripts/block >> $env{ACTION}" >> SUBSYSTEM=="xen-backend", KERNEL=="vtpm*", RUN+="/etc/xen/scripts/vtpm >> $env{ACTION}" >> SUBSYSTEM=="xen-backend", KERNEL=="vif2-*", >> RUN+="/etc/xen/scripts/vif2 $env{ACTION}" >> SUBSYSTEM=="xen-backend", KERNEL=="vif-*", ACTION=="online", >> RUN+="/etc/xen/scripts/vif-setup online type_if=vif" >> SUBSYSTEM=="xen-backend", KERNEL=="vif-*", ACTION=="offline", >> RUN+="/etc/xen/scripts/vif-setup offline type_if=vif" >> SUBSYSTEM=="xen-backend", KERNEL=="vscsi*", >> RUN+="/etc/xen/scripts/vscsi $env{ACTION}" >> SUBSYSTEM=="xen-backend", ACTION=="remove", >> RUN+="/etc/xen/scripts/xen-hotplug-cleanup" >> KERNEL=="evtchn", NAME="xen/%k" >> SUBSYSTEM=="xen", KERNEL=="blktap[0-9]*", NAME="xen/%k", MODE="0600" >> SUBSYSTEM=="blktap2", KERNEL=="blktap[0-9]*", NAME="xen/blktap-2/%k", >> MODE="0600" >> KERNEL=="blktap-control", NAME="xen/blktap-2/control", MODE="0600" >> KERNEL=="gntdev", NAME="xen/%k", MODE="0600" >> KERNEL=="pci_iomul", NAME="xen/%k", MODE="0600" >> KERNEL=="tapdev[a-z]*", NAME="xen/blktap-2/tapdev%m", MODE="0600" >> SUBSYSTEM=="net", KERNEL=="tap*", ACTION=="add", >> RUN+="/etc/xen/scripts/vif-setup $env{ACTION} type_if=tap" >> >> I guess the responsible lines are: >> >> SUBSYSTEM=="xen-backend", KERNEL=="vif-*", ACTION=="online", >> RUN+="/etc/xen/scripts/vif-setup online type_if=vif" >> SUBSYSTEM=="xen-backend", KERNEL=="vif-*", ACTION=="offline", >> RUN+="/etc/xen/scripts/vif-setup offline type_if=vif" >> >> So this is my testing: >> >> # cp -pvf /etc/xen/scripts/vif-setup /etc/xen/scripts/vif-setup.orig >> # cat > /etc/xen/scripts/vif-setup <<''EOF'' >> #!/bin/bash >> echo "$@" >> $0.log >> /etc/xen/scripts/vif-setup.orig "$@" >> EOF >> >> Now my testing purely on xm/xl trigger hvmdomain power. >> >> Online/Offline get called using xm but xl wise is Online get called >> but not Offline with hvm domains like windows XP/server 2008r2... any >> idea what else can make this behaviour difference between xl/xm? >> >> The /etc/xen/scripts/vif-setup.log as below. >> >> The below is using xl create hvmdomain and get logged: >> online type_if=vif >> online type_if=vif >> add type_if=tap >> add type_if=tap >> When using xl trigger hvmdomain power... no log entry at all. > > Does xl trigger hvmdomain power do anything at all? > Is the guest shutting down?Yes, it does for both xm/xl. Thanks. Kindest regards, Giam Teck Choon