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

Re: [Xen-users] When does Xen close instance disks on shutdown?

On Wed, 2013-05-08 at 09:24 +0100, Thomas Thrainer wrote:
> Hi,
> When does Xen exactly close the disks an instance is using after it is
> shut down? And how is this related to the output of `xm list`?
> We (the Ganeti project) believe to experience some timing issues with
> disks still being used by Xen. Here's essentially what we do:
>  * We have a DRBD volume on top of LVM. That's the disk for our VM.
>  * To shutdown the VM, we do the following:
>   - `xm shutdown <instance>`
>   - `xm list`, and check if <instance> is still there
>   - repeat until `xm list` no longer shows <instance>
>   - de-configure the DRBD volume
> The last step fails every now and then, stating that the volume is
> still in use, presumably because Xen still holds the DRBD volume open.
> So I was wondering when `xm list` stops to display an instance. Is it
> removed from the list after the instance is shut down and all
> resources (including handles) are released by Xen?

I can't say for sure with xm/xend but I think when the domain is
destroyed the *request* for all resources to be freed have been made
(i.e. blkback has been asked to shutdown) but I don't know if xend will
actually wait for them to finish.

AFAIK libxl/xl does wait for the backend to finish clearing up.

>  Or might it be possible that instance disks are still held open, even
> if `xm list` does no longer show the instance? Is there a more
> reliable way to find out when Xen does no longer use a disk?

You might be able to poll xenstore for the backend going away or perhaps
integrate with the block hotplug scripts. However I can't say for sure
if either of those will actually work with xend...


Xen-users mailing list



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