Class: Ansible::Ruby::Modules::Vmware_guest
- Inherits:
-
Base
- Object
- Ansible::Ruby::Models::Base
- Base
- Ansible::Ruby::Modules::Vmware_guest
- Defined in:
- lib/ansible/ruby/modules/generated/cloud/vmware/vmware_guest.rb
Overview
This module can be used to create new virtual machines from templates or other virtual machines, manage power state of virtual machine such as power on, power off, suspend, shutdown, reboot, restart etc., modify various virtual machine components like network, disk, customization etc., rename a virtual machine and remove a virtual machine with associated components.
Instance Method Summary collapse
-
#annotation ⇒ Object?
A note or annotation to include in the virtual machine.
-
#cdrom ⇒ Hash?
A CD-ROM configuration for the virtual machine.,Valid attributes are:, - C(type) (string): The type of CD-ROM, valid options are C(none), C(client) or C(iso).
-
#cluster ⇒ String?
The cluster name where the virtual machine will run.,This is a required parameter, if C(esxi_hostname) is not set.,C(esxi_hostname) and C(cluster) are mutually exclusive parameters.,This parameter is case sensitive.
-
#customization ⇒ Hash?
Parameters for OS customization when cloning from the template or the virtual machine.,Not all operating systems are supported for customization with respective vCenter version, please check VMware documentation for respective OS customization.,For supported customization operating system matrix, (see U(partnerweb.vmware.com/programs/guestOS/guest-os-customization-matrix.pdf)),All parameters and VMware object names are case sensitive.,Linux based OSes requires Perl package to be installed for OS customizations.,Common parameters (Linux/Windows):, - C(dns_servers) (list): List of DNS servers to configure., - C(dns_suffix) (list): List of domain suffixes, also known as DNS search path (default: C(domain) parameter)., - C(domain) (string): DNS domain name to use., - C(hostname) (string): Computer hostname (default: shorted C(name) parameter).
-
#customization_spec ⇒ Object?
Unique name identifying the requested customization specification.,This parameter is case sensitive.,If set, then overrides C(customization) parameter values.
-
#customvalues ⇒ Object?
Define a list of custom values to set on virtual machine.,A custom value object takes two fields C(key) and C(value).,Incorrect key and values will be ignored.
-
#datacenter ⇒ String?
Destination datacenter for the deploy operation.,This parameter is case sensitive.
-
#datastore ⇒ String?
Specify datastore or datastore cluster to provision virtual machine.,This will take precendence over “disk.datastore” parameter.,This parameter is useful to override datastore or datastore cluster setting.,For example, when user has different datastore or datastore cluster for templates and virtual machines.,Please see example for more usage.
-
#disk ⇒ Array<Hash>, ...
A list of disks to add.,This parameter is case sensitive.,Resizing disks is not supported.,Removing existing disks of the virtual machine is not supported.,Valid attributes are:, - C(size_) (integer): Disk storage size in specified unit., - C(type) (string): Valid values are:, - C(thin) thin disk, - C(eagerzeroedthick) eagerzeroedthick disk, added in version 2.5, Default: C(None) thick disk, no eagerzero., - C(datastore) (string): Datastore to use for the disk.
-
#esxi_hostname ⇒ String?
The ESXi hostname where the virtual machine will run.,This is a required parameter, if C(cluster) is not set.,C(esxi_hostname) and C(cluster) are mutually exclusive parameters.,This parameter is case sensitive.
-
#folder ⇒ String?
Destination folder, absolute path to find an existing guest or create the new guest.,The folder should include the datacenter.
-
#force ⇒ :yes, ...
Ignore warnings and complete the actions.,This parameter is useful while removing virtual machine which is powered on state.,This module reflects the VMware vCenter API and UI workflow, as such, in some cases the ‘force` flag will be mandatory to perform the action to ensure you are certain the action has to be taken, no matter what the consequence.
-
#guest_id ⇒ String?
Set the guest ID.,This parameter is case sensitive.,Examples:, virtual machine with RHEL7 64 bit, will be ‘rhel7_64Guest’, virtual machine with CensOS 64 bit, will be ‘centos64Guest’, virtual machine with Ubuntu 64 bit, will be ‘ubuntu64Guest’,This field is required when creating a virtual machine.,Valid values are referenced here: U(pubs.vmware.com/vsphere-6-5/topic/com.vmware.wssdk.apiref.doc/vim.vm.GuestOsDescriptor.GuestOsIdentifier.html)rn.
-
#hardware ⇒ Hash?
Manage virtual machine’s hardware attributes.,All parameters case sensitive.,Valid attributes are:, - C(hotadd_cpu) (boolean): Allow virtual CPUs to be added while the virtual machine is running., - C(hotremove_cpu) (boolean): Allow virtual CPUs to be removed while the virtual machine is running.
-
#is_template ⇒ :yes, ...
Flag the instance as a template.,This will mark the given virtual machine as template.
-
#linked_clone ⇒ :yes, ...
Whether to create a linked clone from the snapshot specified.,If specified, then C(snapshot_src) is required parameter.
-
#name ⇒ String
Name of the virtual machine to work with.,Virtual machine names in vCenter are not necessarily unique, which may be problematic, see C(name_match).,If multiple virtual machines with same name exists, then C(folder) is required parameter to identify uniqueness of the virtual machine.,This parameter is required, if C(state) is set to C(poweredon), C(poweredoff), C(present), C(restarted), C(suspended) and virtual machine does not exists.,This parameter is case sensitive.
-
#name_match ⇒ :first, ...
If multiple virtual machines matching the name, use the first or last found.
-
#networks ⇒ Array<Hash>, ...
A list of networks (in the order of the NICs).,Removing NICs is not allowed, while reconfiguring the virtual machine.,All parameters and VMware object names are case sensetive.,One of the below parameters is required per entry:, - C(name) (string): Name of the portgroup or distributed virtual portgroup for this interface.
-
#resource_pool ⇒ Object?
Use the given resource pool for virtual machine operation.,This parameter is case sensitive.,Resource pool should be child of the selected host parent.
-
#snapshot_src ⇒ Object?
Name of the existing snapshot to use to create a clone of a virtual machine.,This parameter is case sensitive.,While creating linked clone using C(linked_clone) parameter, this parameter is required.
-
#state ⇒ :present, ...
Specify state of the virtual machine be in.,If C(state) is set to C(present) and virtual machine exists, ensure the virtual machine configurations conforms to task arguments.,If C(state) is set to C(absent) and virtual machine exists, then the specified virtual machine is removed with its associated components.,If C(state) is set to one of the following C(poweredon), C(poweredoff), C(present), C(restarted), C(suspended) and virtual machine does not exists, then virtual machine is deployed with given parameters.,If C(state) is set to C(poweredon) and virtual machine exists with powerstate other than powered on, then the specified virtual machine is powered on.,If C(state) is set to C(poweredoff) and virtual machine exists with powerstate other than powered off, then the specified virtual machine is powered off.,If C(state) is set to C(restarted) and virtual machine exists, then the virtual machine is restarted.,If C(state) is set to C(suspended) and virtual machine exists, then the virtual machine is set to suspended mode.,If C(state) is set to C(shutdownguest) and virtual machine exists, then the virtual machine is shutdown.,If C(state) is set to C(rebootguest) and virtual machine exists, then the virtual machine is rebooted.
-
#state_change_timeout ⇒ Integer?
If the C(state) is set to C(shutdownguest), by default the module will return immediately after sending the shutdown signal.,If this argument is set to a positive integer, the module will instead wait for the virtual machine to reach the poweredoff state.,The value sets a timeout in seconds for the module to wait for the state change.
-
#template ⇒ String?
Template or existing virtual machine used to create new virtual machine.,If this value is not set, virtual machine is created without using a template.,If the virtual machine already exists, this parameter will be ignored.,This parameter is case sensitive.
-
#uuid ⇒ String?
UUID of the virtual machine to manage if known, this is VMware’s unique identifier.,This is required if C(name) is not supplied.,If virtual machine does not exists, then this parameter is ignored.,Please note that a supplied UUID will be ignored on virtual machine creation, as VMware creates the UUID internally.
-
#vapp_properties ⇒ Array<Hash>, ...
A list of vApp properties,For full list of attributes and types refer to: U(github.com/vmware/pyvmomi/blob/master/docs/vim/vApp/PropertyInfo.rst),Basic attributes are:, - C(id) (string): Property id - required., - C(value) (string): Property value., - C(type) (string): Value type, string type by default., - C(operation): C(remove): This attribute is required only when removing properties.
-
#wait_for_ip_address ⇒ :yes, ...
Wait until vCenter detects an IP address for the virtual machine.,This requires vmware-tools (vmtoolsd) to properly work after creation.,vmware-tools needs to be installed on the given virtual machine in order to work with this parameter.
Methods inherited from Base
Methods inherited from Ansible::Ruby::Models::Base
attr_option, attr_options, attribute, fix_inclusion, #initialize, remove_existing_validations, #to_h, validates
Constructor Details
This class inherits a constructor from Ansible::Ruby::Models::Base
Instance Method Details
#annotation ⇒ Object?
91 |
# File 'lib/ansible/ruby/modules/generated/cloud/vmware/vmware_guest.rb', line 91 attribute :annotation |
#cdrom ⇒ Hash?
53 |
# File 'lib/ansible/ruby/modules/generated/cloud/vmware/vmware_guest.rb', line 53 attribute :cdrom |
#cluster ⇒ String?
83 |
# File 'lib/ansible/ruby/modules/generated/cloud/vmware/vmware_guest.rb', line 83 attribute :cluster |
#customization ⇒ Hash?
101 |
# File 'lib/ansible/ruby/modules/generated/cloud/vmware/vmware_guest.rb', line 101 attribute :customization |
#customization_spec ⇒ Object?
109 |
# File 'lib/ansible/ruby/modules/generated/cloud/vmware/vmware_guest.rb', line 109 attribute :customization_spec |
#customvalues ⇒ Object?
94 |
# File 'lib/ansible/ruby/modules/generated/cloud/vmware/vmware_guest.rb', line 94 attribute :customvalues |
#datacenter ⇒ String?
79 |
# File 'lib/ansible/ruby/modules/generated/cloud/vmware/vmware_guest.rb', line 79 attribute :datacenter |
#datastore ⇒ String?
112 |
# File 'lib/ansible/ruby/modules/generated/cloud/vmware/vmware_guest.rb', line 112 attribute :datastore |
#disk ⇒ Array<Hash>, ...
49 |
# File 'lib/ansible/ruby/modules/generated/cloud/vmware/vmware_guest.rb', line 49 attribute :disk |
#esxi_hostname ⇒ String?
87 |
# File 'lib/ansible/ruby/modules/generated/cloud/vmware/vmware_guest.rb', line 87 attribute :esxi_hostname |
#folder ⇒ String?
37 |
# File 'lib/ansible/ruby/modules/generated/cloud/vmware/vmware_guest.rb', line 37 attribute :folder |
#force ⇒ :yes, ...
75 |
# File 'lib/ansible/ruby/modules/generated/cloud/vmware/vmware_guest.rb', line 75 attribute :force |
#guest_id ⇒ String?
45 |
# File 'lib/ansible/ruby/modules/generated/cloud/vmware/vmware_guest.rb', line 45 attribute :guest_id |
#hardware ⇒ Hash?
41 |
# File 'lib/ansible/ruby/modules/generated/cloud/vmware/vmware_guest.rb', line 41 attribute :hardware |
#is_template ⇒ :yes, ...
33 |
# File 'lib/ansible/ruby/modules/generated/cloud/vmware/vmware_guest.rb', line 33 attribute :is_template |
#linked_clone ⇒ :yes, ...
71 |
# File 'lib/ansible/ruby/modules/generated/cloud/vmware/vmware_guest.rb', line 71 attribute :linked_clone |
#name ⇒ String
17 |
# File 'lib/ansible/ruby/modules/generated/cloud/vmware/vmware_guest.rb', line 17 attribute :name |
#name_match ⇒ :first, ...
21 |
# File 'lib/ansible/ruby/modules/generated/cloud/vmware/vmware_guest.rb', line 21 attribute :name_match |
#networks ⇒ Array<Hash>, ...
97 |
# File 'lib/ansible/ruby/modules/generated/cloud/vmware/vmware_guest.rb', line 97 attribute :networks |
#resource_pool ⇒ Object?
57 |
# File 'lib/ansible/ruby/modules/generated/cloud/vmware/vmware_guest.rb', line 57 attribute :resource_pool |
#snapshot_src ⇒ Object?
68 |
# File 'lib/ansible/ruby/modules/generated/cloud/vmware/vmware_guest.rb', line 68 attribute :snapshot_src |
#state ⇒ :present, ...
13 |
# File 'lib/ansible/ruby/modules/generated/cloud/vmware/vmware_guest.rb', line 13 attribute :state |
#state_change_timeout ⇒ Integer?
64 |
# File 'lib/ansible/ruby/modules/generated/cloud/vmware/vmware_guest.rb', line 64 attribute :state_change_timeout |
#template ⇒ String?
29 |
# File 'lib/ansible/ruby/modules/generated/cloud/vmware/vmware_guest.rb', line 29 attribute :template |
#uuid ⇒ String?
25 |
# File 'lib/ansible/ruby/modules/generated/cloud/vmware/vmware_guest.rb', line 25 attribute :uuid |
#vapp_properties ⇒ Array<Hash>, ...
105 |
# File 'lib/ansible/ruby/modules/generated/cloud/vmware/vmware_guest.rb', line 105 attribute :vapp_properties |
#wait_for_ip_address ⇒ :yes, ...
60 |
# File 'lib/ansible/ruby/modules/generated/cloud/vmware/vmware_guest.rb', line 60 attribute :wait_for_ip_address |