def create_dummy_vm(name, service_instance, vm_folder, resource_pool,
                    datastore):
    vm_name = 'MARVEL-' + name
    datastore_path = '[' + datastore + '] ' + vm_name

    # bare minimum VM shell, no disks. Feel free to edit
    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, 128MB of RAM.
dataset/ETHPy150Open vmware/pyvmomi-community-samples/samples/create_random_marvel_vms.py/create_dummy_vm