def get_dummy_vm_create_spec(client_factory, name, data_store_name):
 config_spec = client_factory.create('ns0:VirtualMachineConfigSpec')
 config_spec.name = name
 config_spec.guestId = 'otherGuest'
 vm_file_info = client_factory.create('ns0:VirtualMachineFileInfo')
 vm_file_info.vmPathName = (('[' + data_store_name) + ']')
 config_spec.files = vm_file_info
 tools_info = client_factory.create('ns0:ToolsConfigInfo')
 tools_info.afterPowerOn = True
 tools_info.afterResume = True
 tools_info.beforeGuestStandby = True
 tools_info.beforeGuestShutdown = True
 tools_info.beforeGuestReboot = True
 config_spec.tools = tools_info
 config_spec.numCPUs = 1
 config_spec.memoryMB = 4
 controller_key = (-101)
 controller_spec = create_controller_spec(client_factory, controller_key)
 disk_spec = create_virtual_disk_spec(client_factory, 1024, controller_key)
 device_config_spec = [controller_spec, disk_spec]
 config_spec.deviceChange = device_config_spec
 return config_spec

def get_dummy_vm_create_spec ( client_factory , name , data_store_name ) : config_spec = client_factory . create ( 'ns0:VirtualMachineConfigSpec' ) config_spec . name = name config_spec . guestId = 'otherGuest' vm_file_info = client_factory . create ( 'ns0:VirtualMachineFileInfo' ) vm_file_info . vmPathName = ( ( '[' + data_store_name ) + ']' ) config_spec . files = vm_file_info tools_info = client_factory . create ( 'ns0:ToolsConfigInfo' ) tools_info . afterPowerOn = True tools_info . afterResume = True tools_info . beforeGuestStandby = True tools_info . beforeGuestShutdown = True tools_info . beforeGuestReboot = True config_spec . tools = tools_info config_spec . numCPUs = 1 config_spec . memoryMB = 4 controller_key = ( - 101 ) controller_spec = create_controller_spec ( client_factory , controller_key ) disk_spec = create_virtual_disk_spec ( client_factory , 1024 , controller_key ) device_config_spec = [ controller_spec , disk_spec ] config_spec . deviceChange = device_config_spec return config_spec
builds the dummy vm create spec .