@ -88,6 +88,11 @@ options:
- A key, value pair of any extra values you want set or changed in the vmx file of the VM. Useful to set advanced options on the VM.
- A key, value pair of any extra values you want set or changed in the vmx file of the VM. Useful to set advanced options on the VM.
required: false
required: false
default: null
default: null
vm_hw_version:
description:
- Desired hardware version identifier (for example, "vmx-08" for vms that needs to be managed with vSphere Client). Note that changing hardware version of existing vm is not supported.
required: false
default: null
vmware_guest_facts:
vmware_guest_facts:
description:
description:
- Gather facts from vCenter on a particular VM
- Gather facts from vCenter on a particular VM
@ -593,7 +598,7 @@ def reconfigure_vm(vsphere_client, vm, module, esxi, resource_pool, cluster_name
module.exit_json(changed=False)
module.exit_json(changed=False)
def create_vm(vsphere_client, module, esxi, resource_pool, cluster_name, guest, vm_extra_config, vm_hardware, vm_disk, vm_nic, state):
def create_vm(vsphere_client, module, esxi, resource_pool, cluster_name, guest, vm_extra_config, vm_hardware, vm_disk, vm_nic, vm_hw_version, state):
datacenter = esxi['datacenter']
datacenter = esxi['datacenter']
esxi_hostname = esxi['hostname']
esxi_hostname = esxi['hostname']
@ -696,6 +701,8 @@ def create_vm(vsphere_client, module, esxi, resource_pool, cluster_name, guest,
# add parameters to the create vm task
# add parameters to the create vm task
create_vm_request = VI.CreateVM_TaskRequestMsg()
create_vm_request = VI.CreateVM_TaskRequestMsg()
config = create_vm_request.new_config()
config = create_vm_request.new_config()
if vm_hw_version:
config.set_element_version(vm_hw_version)
vmfiles = config.new_files()
vmfiles = config.new_files()
datastore_name, ds = find_datastore(
datastore_name, ds = find_datastore(
module, vsphere_client, vm_disk['disk1']['datastore'], config_target)
module, vsphere_client, vm_disk['disk1']['datastore'], config_target)
@ -1063,6 +1070,7 @@ def main():
vm_nic=dict(required=False, type='dict', default={}),
vm_nic=dict(required=False, type='dict', default={}),
vm_hardware=dict(required=False, type='dict', default={}),
vm_hardware=dict(required=False, type='dict', default={}),
vm_extra_config=dict(required=False, type='dict', default={}),
vm_extra_config=dict(required=False, type='dict', default={}),
vm_hw_version=dict(required=False, default=None, type='str'),
resource_pool=dict(required=False, default=None, type='str'),
resource_pool=dict(required=False, default=None, type='str'),
cluster=dict(required=False, default=None, type='str'),
cluster=dict(required=False, default=None, type='str'),
force=dict(required=False, choices=BOOLEANS, default=False),
force=dict(required=False, choices=BOOLEANS, default=False),
@ -1099,6 +1107,7 @@ def main():
vm_nic = module.params['vm_nic']
vm_nic = module.params['vm_nic']
vm_hardware = module.params['vm_hardware']
vm_hardware = module.params['vm_hardware']
vm_extra_config = module.params['vm_extra_config']
vm_extra_config = module.params['vm_extra_config']
vm_hw_version = module.params['vm_hw_version']
esxi = module.params['esxi']
esxi = module.params['esxi']
resource_pool = module.params['resource_pool']
resource_pool = module.params['resource_pool']
cluster = module.params['cluster']
cluster = module.params['cluster']
@ -1200,6 +1209,7 @@ def main():
vm_hardware=vm_hardware,
vm_hardware=vm_hardware,
vm_disk=vm_disk,
vm_disk=vm_disk,
vm_nic=vm_nic,
vm_nic=vm_nic,
vm_hw_version=vm_hw_version,
state=state
state=state
)
)