def stopVM(id,vm): try: #Just try to stop XendManager.stopDomain(vm) XenProvisioningDispatcher.logger.info("VM named "+vm.name+" has been stopped.") #Send async notification XmlRpcClient.sendAsyncProvisioningActionStatus(id,"SUCCESS","") except Exception as e: XenProvisioningDispatcher.logger.error(str(e)) #Send async notification XmlRpcClient.sendAsyncProvisioningActionStatus(id,"FAILED",str(e)) return
def stopVM(id, vm): try: #Just try to stop XendManager.stopDomain(vm) XenProvisioningDispatcher.logger.info("VM named " + vm.name + " has been stopped.") #Send async notification XmlRpcClient.sendAsyncProvisioningActionStatus(id, "SUCCESS", "") except Exception as e: XenProvisioningDispatcher.logger.error(str(e)) #Send async notification XmlRpcClient.sendAsyncProvisioningActionStatus( id, "FAILED", str(e)) return
def deleteVM(id,vm): try: try: #if it wasn't stopped, do it XendManager.stopDomain(vm) except Exception as e: pass #Trigger Hd Deletion in Remote HdManager.delete(vm) #Send async notification XmlRpcClient.sendAsyncProvisioningActionStatus(id,"SUCCESS","") except Exception as e: XenProvisioningDispatcher.logger.error(str(e)) #Send async notification XmlRpcClient.sendAsyncProvisioningActionStatus(id,"FAILED",str(e)) return
def deleteVM(id, vm): try: try: #if it wasn't stopped, do it XendManager.stopDomain(vm) except Exception as e: pass #Trigger Hd Deletion in Remote HdManager.delete(vm) #Send async notification XmlRpcClient.sendAsyncProvisioningActionStatus(id, "SUCCESS", "") except Exception as e: XenProvisioningDispatcher.logger.error(str(e)) #Send async notification XmlRpcClient.sendAsyncProvisioningActionStatus( id, "FAILED", str(e)) return