From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nathan March Subject: Re: Domains not being destroyed properly Date: Fri, 17 Jun 2011 11:12:41 -0700 Message-ID: <4DFB9919.8030502@gt.net> References: <4DFB3A90.70707@overnetdata.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <4DFB3A90.70707@overnetdata.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Anthony Wright Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org On 6/17/2011 4:29 AM, Anthony Wright wrote: > As an extra question... Is there a way to be notified when a domain is > destroyed other than leaving the 'xl create' process lying around? I'd > like to know when any domain is destroyed, and leaving a large number of > processes lying around just to be able to do this seems rather ugly. In > the past I've editted some of the python code to achieve this, but my > patch doesn't work with 4.1, so I'm seeing if there's an official way to > do this before I work out a new patch. Not ideal, but my approach was to add hook scripts into the block device script and consider a vm down if xvda1 has been removed: Line 229 (below the FRONTEND_UUID): /path/to/block add ${XENBUS_PATH} Line 324 (below "remove)"): /path/to/block remove ${XENBUS_PATH} xen1 scripts # cat block #!/bin/bash set -x -e STATE="$1" PATH="$2" VMNAME=$(/usr/bin/xenstore-read ${PATH}/domain); DEV=$(/usr/bin/xenstore-read ${PATH}/dev); if [[ "$DEV" == "xvda1" ]]; then # Do stuff fi; exit 0 - Nathan