- memReserve = vm_obj.config.hardware.memoryMB
- spec = vim.vm.ConfigSpec()
- spec.memoryAllocation = vim.ResourceAllocationInfo(reservation=memReserve)
- task = vm_obj.ReconfigVM_Task(spec=spec)
- if task:
- result = self.wait_for_vcenter_task(task, vcenter_conect)
- self.logger.info("Reserved memory {} MB for "
- "VM VM status: {}".format(str(memReserve), result))
- else:
- self.logger.info("Fail to reserved memory {} to VM {}".format(
- str(memReserve), str(vm_obj)))