Tomasz Chmielewski
2007-Nov-19 14:25 UTC
[Xen-users] which disks/block device does Xen use at the moment?
I''m sending it again, as the message sent on 16.11.2007 didn''t get to the list. Is there a way to guess which block devices / disk does Xen use at the moment? I use Xen with iSCSI. I connect to 50 iSCSI targets or more on each Xen server - and I get "virtual disks" ranging from /dev/sda to /dev/sdbl etc. - it''s a lot. Sometimes, I want to log out a given iSCSI connection (parameters changed on a target etc.) - but before I actually do it, I would like to know if that iSCSI drive is not used by Xen. In other word - is there a way to check if Xen uses block device /dev/sda, /dev/sdu or /dev/sdbb etc.? -- Tomasz Chmielewski http://wpkg.org _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Nico Kadel-Garcia
2007-Nov-19 15:30 UTC
Re: [Xen-users] which disks/block device does Xen use at the moment?
Tomasz Chmielewski wrote:> I''m sending it again, as the message sent on 16.11.2007 didn''t get to > the list. > > > Is there a way to guess which block devices / disk does Xen use at the > moment? > > I use Xen with iSCSI. > I connect to 50 iSCSI targets or more on each Xen server - and I get > "virtual disks" ranging from /dev/sda to /dev/sdbl etc. - it''s a lot. > > Sometimes, I want to log out a given iSCSI connection (parameters > changed on a target etc.) - but before I actually do it, I would like > to know if that iSCSI drive is not used by Xen. > > In other word - is there a way to check if Xen uses block device > /dev/sda, /dev/sdu or /dev/sdbb etc.? > >Well, what does "mount" say from the DomU, and what does "xm list [DOMAIN] --long" say on the Dom0? _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Tomasz Chmielewski
2007-Nov-19 15:40 UTC
Re: [Xen-users] which disks/block device does Xen use at the moment?
Nico Kadel-Garcia schrieb:> Tomasz Chmielewski wrote: >> I''m sending it again, as the message sent on 16.11.2007 didn''t get to >> the list. >> >> >> Is there a way to guess which block devices / disk does Xen use at the >> moment? >> >> I use Xen with iSCSI. >> I connect to 50 iSCSI targets or more on each Xen server - and I get >> "virtual disks" ranging from /dev/sda to /dev/sdbl etc. - it''s a lot. >> >> Sometimes, I want to log out a given iSCSI connection (parameters >> changed on a target etc.) - but before I actually do it, I would like >> to know if that iSCSI drive is not used by Xen. >> >> In other word - is there a way to check if Xen uses block device >> /dev/sda, /dev/sdu or /dev/sdbb etc.? >> >> > Well, what does "mount" say from the DomUmount from domU would always say its "local" disk, that is, /dev/sda1 or such. And good luck if domU is Windows.> and what does "xm list > [DOMAIN] --long" say on the Dom0?That''s it, certainly I can grep through that output, thanks! Would be great if Xen registered some "holders" in /sys/block for a device it uses - like LVM or RAID does in /sys/block/<device>/holders/ -- Tomasz Chmielewski http://wpkg.org _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Nico Kadel-Garcia
2007-Nov-19 16:11 UTC
Re: [Xen-users] which disks/block device does Xen use at the moment?
Tomasz Chmielewski wrote:> Nico Kadel-Garcia schrieb: >> Tomasz Chmielewski wrote: >>> I''m sending it again, as the message sent on 16.11.2007 didn''t get >>> to the list. >>> >>> >>> Is there a way to guess which block devices / disk does Xen use at >>> the moment? >>> >>> I use Xen with iSCSI. >>> I connect to 50 iSCSI targets or more on each Xen server - and I get >>> "virtual disks" ranging from /dev/sda to /dev/sdbl etc. - it''s a lot. >>> >>> Sometimes, I want to log out a given iSCSI connection (parameters >>> changed on a target etc.) - but before I actually do it, I would >>> like to know if that iSCSI drive is not used by Xen. >>> >>> In other word - is there a way to check if Xen uses block device >>> /dev/sda, /dev/sdu or /dev/sdbb etc.? >>> >>> >> Well, what does "mount" say from the DomU > > mount from domU would always say its "local" disk, that is, /dev/sda1 > or such. And good luck if domU is Windows.Well, yes. I''m sorry if I was unclear: if you have multiple partitions mounted for whatever reason, this gives you a set of references for what the "xm list --long" says is available to the domain.>> and what does "xm list [DOMAIN] --long" say on the Dom0? > > That''s it, certainly I can grep through that output, thanks!Happy to oblige.> > Would be great if Xen registered some "holders" in /sys/block for a > device it uses - like LVM or RAID does in /sys/block/<device>/holders/Hmm. Interesting idea. _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Alex Bodom
2007-Nov-21 06:03 UTC
[Xen-users] Re: which disks/block device does Xen use at the moment?
Hi, Maybe you''ll find these one-liners useful for your case, I''ve wrote them for machines that use image files as their disks: for i in `xm list | grep -v Name | grep -v Domain | awk ''{print $1}''`; do vpath=`xm block-list $i | head -n 2 | tail -n 1 | awk ''{print $7}''`; echo $i: `xenstore-read $vpath/params`; done In other words, I do xm block-list domUname | awk ''{print $7}'' to get virtual paths for domU''s block devices and then xenstore-read $vpath/params to find out which image is in use. You can also try xenstore-read $vpath/node I get a name of loop device that image is connected to through this line. "Nico Kadel-Garcia" <nkadel@gmail.com> wrote in message news:4741B5C7.9010201@gmail.com...> Tomasz Chmielewski wrote: >> Nico Kadel-Garcia schrieb: >> Would be great if Xen registered some "holders" in /sys/block for a >> device it uses - like LVM or RAID does in /sys/block/<device>/holders/_______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users