Skip to content

Commit 2c4f312

Browse files
author
Edouard Bourguignon
committed
Add undeploy and undeploy-hard vm actions
1 parent 0c26aa8 commit 2c4f312

1 file changed

Lines changed: 17 additions & 1 deletion

File tree

oca/vm.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ class VirtualMachine(PoolElement):
1414
'action': 'vm.action',
1515
'migrate': 'vm.migrate',
1616
'deploy': 'vm.deploy',
17+
'undeploy': 'vm.undeploy',
18+
'undeploy-hard': 'vm.undeploy_hard',
1719
'savedisk': 'vm.savedisk',
1820
'delete': 'vm.delete',
1921
'chown': 'vm.chown',
@@ -43,7 +45,9 @@ class VirtualMachine(PoolElement):
4345
'DONE': 'done',
4446
'FAILED': 'fail',
4547
'POWEROFF': 'poff',
46-
'UNDEPLOYED': 'udep'
48+
'UNDEPLOYED': 'udep',
49+
'CLONING': 'clon',
50+
'CLONING_FAILURE': 'fail'
4751
}
4852

4953
LCM_STATE = ['LCM_INIT', 'PROLOG', 'BOOT', 'RUNNING', 'MIGRATE', 'SAVE_STOP', 'SAVE_SUSPEND',
@@ -190,6 +194,18 @@ def deploy(self, host_id):
190194
"""
191195
self.client.call(self.METHODS['deploy'], self.id, host_id)
192196

197+
def undeploy(self):
198+
"""
199+
undeploy the instance of the given vmid
200+
"""
201+
self._action("undeploy")
202+
203+
def undeploy_hard(self):
204+
"""
205+
undeploy hard the instance of the given vmid
206+
"""
207+
self._action("undeploy-hard")
208+
193209
def migrate(self, dest_host):
194210
"""
195211
migrates virtual machine to the target host

0 commit comments

Comments
 (0)