WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] [XENAPI] Added hard shutdown (aka. vm-des

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] [XENAPI] Added hard shutdown (aka. vm-destroy)
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 02 Nov 2006 22:08:44 +0000
Delivery-date: Thu, 02 Nov 2006 21:41:59 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Alastair Tse <atse@xxxxxxxxxxxxx>
# Node ID 858218d94516d0367d474119ead5be27e3f5b383
# Parent  52f449c9dcc562e82ada54ea0a197f1927c3047c
[XENAPI] Added hard shutdown (aka. vm-destroy)

Signed-off-by: Alastair Tse <atse@xxxxxxxxxxxxx>
---
 tools/python/scripts/xapi.py |   11 +++++++++++
 1 files changed, 11 insertions(+)

diff -r 52f449c9dcc5 -r 858218d94516 tools/python/scripts/xapi.py
--- a/tools/python/scripts/xapi.py      Fri Oct 06 11:56:36 2006 +0100
+++ b/tools/python/scripts/xapi.py      Fri Oct 06 11:57:16 2006 +0100
@@ -37,6 +37,7 @@ COMMANDS = {
     'vbd-create': ('<domname> <pycfg>', 'Create VBD attached to domname'),
     'vif-create': ('<domname> <pycfg>', 'Create VIF attached to domname'),
     'vm-delete': ('<domname>', 'Delete VM'),
+    'vm-destroy': ('<name>', 'Hard shutdown a VM with name'),
 }
 
 class OptionError(Exception):
@@ -141,6 +142,16 @@ def xapi_vm_shutdown(*args):
     success = execute(server.VM.clean_shutdown, session, vm_uuid)
     print 'Done.'
 
+def xapi_vm_destroy(*args):
+    if len(args) < 1:
+        raise OptionError("No Domain name specified.")
+
+    server, session = _connect()
+    vm_uuid = execute(server.VM.get_by_label, session, args[0])
+    print 'Shutting down VM with force %s (%s)' % (args[0], vm_uuid)
+    success = execute(server.VM.hard_shutdown, session, vm_uuid)
+    print 'Done.'    
+
 def xapi_vbd_create(*args):
     if len(args) < 2:
         raise OptionError("Configuration file not specified")

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] [XENAPI] Added hard shutdown (aka. vm-destroy), Xen patchbot-unstable <=