def create_dummy_vm(name, service_instance, vm_folder, resource_pool, datastore):
 vm_name = ('MARVEL-' + name)
 datastore_path = ((('[' + datastore) + '] ') + vm_name)
 vmx_file = vim.vm.FileInfo(logDirectory=None, snapshotDirectory=None, suspendDirectory=None, vmPathName=datastore_path)
 config = vim.vm.ConfigSpec(name=vm_name, memoryMB=128, numCPUs=1, files=vmx_file, guestId='dosGuest', version='vmx-07')
 print 'Creating VM {}...'.format(vm_name)
 task = vm_folder.CreateVM_Task(config=config, pool=resource_pool)
 tasks.wait_for_tasks(service_instance, [task])

def create_dummy_vm ( name , service_instance , vm_folder , resource_pool , datastore ) : vm_name = ( 'MARVEL-' + name ) datastore_path = ( ( ( '[' + datastore ) + '] ' ) + vm_name ) vmx_file = vim . vm . FileInfo ( logDirectory = None , snapshotDirectory = None , suspendDirectory = None , vmPathName = datastore_path ) config = vim . vm . ConfigSpec ( name = vm_name , memoryMB = 128 , numCPUs = 1 , files = vmx_file , guestId = 'dosGuest' , version = 'vmx-07' ) print 'Creating VM {}...' . format ( vm_name ) task = vm_folder . CreateVM_Task ( config = config , pool = resource_pool ) tasks . wait_for_tasks ( service_instance , [ task ] )
creates a dummy virtualmachine with 1 vcpu .