Every dog has a blog!
[ start | index | login or register ]
start > 2011-05-03 > 1

How to get the pathes and names of blockdevices (vbd) in XEN

Created by derjohn. Last edited by derjohn, 295 days ago. Viewed 227 times. #3
[diff] [history] [edit] [rdf]
labels
attachments
xenstore-vbdresolve (336)

How to get the pathes and names of blockdevices (vbd) in XEN

I always wondered how the block device (vdb) management is done in XEN for domUs without restarting the domU. After I discovered "xm block-attach" to attach ISO-Images or LVMs on the fly, I looked for a way to check which vbds are already attachmed to a domU. As there is no single command to do that, I created a script called "/usr/local/sbin/xenstore-vbdresolve" to do that lookup:

#!/bin/sh

if [ -n "$1" ]; then DOMUID=$(xm domid $1) else echo "usage: $0 <xendomain>" exit 1 fi

for i in $(xenstore-list /local/domain/${DOMUID}/device/vbd); do

TEMPPATH=$(xenstore-read /local/domain/${DOMUID}/device/vbd/$i/backend); echo -n "$(xenstore-read ${TEMPPATH}/dev): " xenstore-read ${TEMPPATH}/params ;

done

It will deliver an output such like this example:

# xenstore-vbdresolve mydomu hda: /dev/vg2/mydomu-raw hdc: /install/myisoimage.iso
no comments | post comment

< February 2012 >
SunMonTueWedThuFriSat
1234
567891011
12131415161718
19202122232425
26272829


Logged in Users: (1)
… and 2 Guests.

Blogrolling:
>>Blog des Wahnsinns
>>Daniel Holbach's Blog
>>Matt Cutt's blog
>>Randgruppentourismus

XHTML 1.0 validated
CSS validated
RSS 2.0 validated
RSS Feed

Hinweise zur Formatierung
snipsnap-help.

Powered by
SnipSnap 1.0b1-snipit

Ads will be placed here!

dem john sein blog | Impressum: Andreas John, Frankfurter Str. 98a, 63067 Offenbach, E-Mail: himself@derjohn.de