The following sections provide solution to the problems you might encounter while performing provisioning actions on VMs managed by the VMware vCenter hypervisor:
Unable to perform any Provisioning Adapter Action after the Save Config Action on the vSphere Managed VM
In the Orchestration Console, click
> the vSphere managed VM.The
tab is displayed by default.In the Virtual Machine Configuration panel, set the value of
to a 128-bit hexadecimal value.Right-click the vSphere managed VM, then click
.(503) Service Unavailable Errors Might Occur while Cloning vSphere VMs
Clone : (503)Service Unavailable
Invalid Datastore Path Error
VMSaveConfig : Invalid datastore path '/vmimages/tools-isoimages/linux.iso'
<policy> <vdisk> <fact name="location" type="String" value="[] /vmimages/tools-isoimages/linux.iso" /> </vdisk> </policy>
Running Provisioning Operations on a Batch of vSphere VMs Results in JDL Event Handler Errors
Job 'testadmin.r_testvm_resync_batch.15684' terminated because of failure. Reason: job exceeded max limit of jdl event handler Job 'testadmin.r_testvm_resync_batch.15684' terminated because of failure. Reason: job exceeded max limit of jdl event handler
You also see the following error in server.log:
08.24 17:32:59: JobManager,NOTICE: job instance 'testadmin.r_testvm_resync_batch.15082' failed 08.24 17:46:25: JobManager,NOTICE: job instance 'testadmin.r_testvm_resync_batch.15684' failed 08.24 17:46:25: Broker,ERROR: Exception in thread "JDL Event (job_failed_event) jobId (testadmin.r_testvm_resync_batch.15684)" 08.24 17:46:25: Broker,ERROR: ValueError: I/O operation on closed file
import time class testvm_resync(Job): def job_started_event(self): vms_group = getMatrix().getGroup(TYPE_RESOURCE, 'VMs') # gets the matrix object id for 'VMs' group vms = vms_group.getMembers() # gets the group members of 'VMs' group for vm in vms: id = vm.getFact("resource.id") #gets the resource.id fact of a vm thevmtype = vm.getFact("resource.type") # find the vm type if id.startswith("c-") and thevmtype == 'VM': # search criteria vmstate = vm.getFact("resource.provision.state") # find the vm state thevm = getMatrix().getGridObject(TYPE_RESOURCE, id); #gets the vm's id thevm.check() # vm life cycle operations time.sleep(2*60) #pause time - 2 min
The rewritten script might look like this:
import time class testvm_resync(Job): def job_started_event(self): timer = Timer(self.prov,0) def prov(self): vms_group = getMatrix().getGroup(TYPE_RESOURCE, 'VMs') # gets the matrix object id for 'VMs' group vms = vms_group.getMembers() # gets the group members of 'VMs' group for vm in vms: id = vm.getFact("resource.id") #gets the resource.id fact of a vm thevmtype = vm.getFact("resource.type") # find the vm type if id.startswith("c-") and thevmtype == 'VM': # search criteria vmstate = vm.getFact("resource.provision.state") # find the vm state thevm = getMatrix().getGridObject(TYPE_RESOURCE, id); #gets the vm's id thevm.check() # vm life cycle operations time.sleep(2*60) #pause time - 2 min
This change lets the job_started_event end after transferring the process to another JDL event/method to run on a timer basis. In this example, the timer is set for 10 seconds, but you could set it to zero.
The timer is normally used for callback. For example, the vSphere provisioning adapter uses Timer to check every 30 seconds whether a vSphere action is still working or dead.
This not isolated to the check() action. It includes other actions such as provision(), shutdown(), suspend(), checkpoint(), saveConfig() and restart().
Moving a VM Host in vSphere Results in Duplicate Repositories