[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-users] How to list the drives a DomU is using, and their types -- with or without a parition -- from the Dom0?



On Mon, Feb 15, 2016 at 11:02:16AM -0800, billb@xxxxxxx wrote:
> Backing up Xen DomUs' LVM disks
> 
> When I install a DomU from a OS install disk, I pass it an LV I created on 
> the Dom0.
> 
> So the initial .cfg has 
> 
>       disk = [ 'phy:/dev/VG0/GUEST01_OS,hda,w', 
> 'file:/home/isos/OS.iso,hdd:cdrom,r',]
> 
> The installer process creates a partition on that LV.
> 
> Later I'll often add another LV, created on the Dom0 host, for the guest to 
> use for data.
> 
> So my run-time .cfg ends up with, for example
> 
>       disk = [ 'phy:/dev/VG0/GUEST01_OS,hda,w', 
> 'phy:/dev/VG0/GUEST01_DATA,hdb,w',]
> 
> Now I want to make a backup of this Guest, using LV snapshots.
> 
> /dev/VG0/GUEST01_DATA I can snapshot directly.
> 
> But because 'hda' has a partition in it, you have to 1st
> 
>       kpartx -av /dev/VG0/GUEST01_OS
> 
> then snapshot the mounted partition inside
> 
>       /dev/mapper/VG0-GUEST01_OS-part1
> 
> This works fine -- when you know ahead of time if each Guest disk has a 
> partition in it or not.
> 
> I want to automate/script the backup process.
> 
> How can I query a DomU Guest from the Dom0 host to
> 
>   (1) list all the drives in use
>

Try xl block-list $DOMU?

> and
> 
>   (2) identify each drive's "type" -- with, or without, a partition in it?
>

This is not specific to Xen. I guess you can write a script to parse
output from "kpartx -l"?

Wei.

> Bill
> 
> _______________________________________________
> Xen-users mailing list
> Xen-users@xxxxxxxxxxxxx
> http://lists.xen.org/xen-users

_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxx
http://lists.xen.org/xen-users


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.