2015-03-31 16:06:20 +00:00
|
|
|
===================================
|
|
|
|
Getting Started With VMware vSphere
|
|
|
|
===================================
|
|
|
|
|
|
|
|
VMware vSphere is a server virtualization platform for building cloud
|
|
|
|
infrastructure.
|
|
|
|
|
|
|
|
|
|
|
|
Dependencies
|
|
|
|
============
|
2015-03-31 18:25:53 +00:00
|
|
|
The vmware module for Salt Cloud requires the ``pyVmomi`` package, which is
|
2015-03-31 16:06:20 +00:00
|
|
|
available at PyPI:
|
|
|
|
|
|
|
|
https://pypi.python.org/pypi/pyvmomi
|
|
|
|
|
|
|
|
This package can be installed using `pip` or `easy_install`:
|
|
|
|
|
|
|
|
.. code-block:: bash
|
|
|
|
|
|
|
|
pip install pyvmomi
|
|
|
|
easy_install pyvmomi
|
|
|
|
|
|
|
|
|
|
|
|
Configuration
|
|
|
|
=============
|
|
|
|
The VMware cloud module needs the vCenter URL, username and password to be
|
|
|
|
set up in the cloud configuration at
|
|
|
|
``/etc/salt/cloud.providers`` or ``/etc/salt/cloud.providers.d/vmware.conf``:
|
|
|
|
|
|
|
|
.. code-block:: yaml
|
|
|
|
|
|
|
|
my-vmware-config:
|
|
|
|
provider: vmware
|
|
|
|
user: DOMAIN\user
|
|
|
|
password: verybadpass
|
|
|
|
url: vcenter01.domain.com
|
|
|
|
|
|
|
|
vmware-vcenter02:
|
|
|
|
provider: vmware
|
|
|
|
user: DOMAIN\user
|
|
|
|
password: verybadpass
|
|
|
|
url: vcenter02.domain.com
|
|
|
|
|
|
|
|
vmware-vcenter03:
|
|
|
|
provider: vmware
|
|
|
|
user: DOMAIN\user
|
|
|
|
password: verybadpass
|
|
|
|
url: vcenter03.domain.com
|
|
|
|
|
|
|
|
|
|
|
|
Profiles
|
|
|
|
========
|
|
|
|
Set up an initial profile at ``/etc/salt/cloud.profiles`` or
|
2015-03-31 18:25:53 +00:00
|
|
|
``/etc/salt/cloud.profiles.d/vmware.conf``:
|
2015-03-31 16:06:20 +00:00
|
|
|
|
|
|
|
.. code-block:: yaml
|
|
|
|
|
|
|
|
vmware-centos6.5:
|
|
|
|
provider: vmware-vcenter01
|
|
|
|
clonefrom: test-vm
|
2015-04-03 20:03:52 +00:00
|
|
|
|
2015-03-31 16:06:20 +00:00
|
|
|
## Optional arguments
|
2015-04-01 09:54:52 +00:00
|
|
|
num_cpus: 4
|
|
|
|
memory: 8192
|
2015-04-03 20:03:52 +00:00
|
|
|
disk:
|
|
|
|
'Hard disk 2':
|
|
|
|
size: 30
|
|
|
|
'Hard disk 3':
|
|
|
|
size: 20
|
|
|
|
'Hard disk 4':
|
|
|
|
size: 5
|
2015-04-04 21:04:07 +00:00
|
|
|
network:
|
|
|
|
'Network adapter 1':
|
|
|
|
name: 10.20.30-400-Test
|
|
|
|
'Network adapter 2':
|
|
|
|
name: 10.30.40-500-Dev
|
|
|
|
type: e1000
|
|
|
|
'Network adapter 3':
|
|
|
|
name: 10.40.50-600-Prod
|
|
|
|
type: vmxnet3
|
2015-04-02 10:28:32 +00:00
|
|
|
datastore: HUGE-DATASTORE-Cluster
|
2015-04-03 20:03:52 +00:00
|
|
|
|
|
|
|
# If cloning from template, either resourcepool or cluster MUST be specified!
|
2015-04-01 18:42:58 +00:00
|
|
|
resourcepool: Resources
|
|
|
|
cluster: Prod
|
2015-04-03 20:03:52 +00:00
|
|
|
|
2015-03-31 16:06:20 +00:00
|
|
|
folder: Development
|
2015-04-01 18:42:58 +00:00
|
|
|
datacenter: DC1
|
2015-03-31 16:06:20 +00:00
|
|
|
host: c4212n-002.domain.com
|
|
|
|
template: False
|
|
|
|
power_on: True
|
|
|
|
|
|
|
|
|
|
|
|
provider
|
2015-03-31 18:25:53 +00:00
|
|
|
Enter the name that was specified when the cloud provider config was created.
|
2015-03-31 16:06:20 +00:00
|
|
|
|
|
|
|
clonefrom
|
2015-04-02 10:56:49 +00:00
|
|
|
Enter the name of the VM/template to clone from.
|
2015-03-31 16:06:20 +00:00
|
|
|
|
2015-04-01 09:54:52 +00:00
|
|
|
num_cpus
|
2015-04-01 18:42:58 +00:00
|
|
|
Enter the number of vCPUS you want the VM/template to have. If not specified, the current
|
2015-04-02 10:28:32 +00:00
|
|
|
VM/template\'s vCPU count is used.
|
2015-04-01 09:54:52 +00:00
|
|
|
|
|
|
|
memory
|
2015-04-01 18:42:58 +00:00
|
|
|
Enter memory (in MB) you want the VM/template to have. If not specified, the current
|
2015-04-02 10:28:32 +00:00
|
|
|
VM/template\'s memory size is used.
|
2015-04-01 09:54:52 +00:00
|
|
|
|
2015-04-03 20:03:52 +00:00
|
|
|
disk
|
|
|
|
Enter the disk specification here. If the hard disk doesn\'t exist, it will be created with
|
|
|
|
the provided size. If the hard disk already exists, it will be expanded if the provided size
|
|
|
|
is greater than the current size of the disk.
|
|
|
|
|
2015-04-04 21:04:07 +00:00
|
|
|
network
|
|
|
|
Enter the network adapter specification here. If the network adapter doesn\'t exist, a new
|
|
|
|
network adapter will be created with the specified network name and type. If the network
|
|
|
|
adapter already exists, it will be reconfigured with the network name specified. Currently,
|
|
|
|
only network adapters of type vmxnet, vmxnet2, vmxnet3, e1000 and e1000e can be created. If
|
|
|
|
the network adapter type specified is not one of these, by default a network adapter of type
|
|
|
|
vmxnet3 will be created.
|
|
|
|
|
2015-03-31 16:06:20 +00:00
|
|
|
datastore
|
2015-04-01 18:42:58 +00:00
|
|
|
Enter the name of the datastore or the datastore cluster where the virtual machine should
|
|
|
|
be located on physical storage. If not specified, the current datastore is used.
|
2015-04-02 10:28:32 +00:00
|
|
|
|
|
|
|
.. note::
|
|
|
|
|
|
|
|
- If you specify a datastore cluster name, DRS Storage recommendation is automatically
|
|
|
|
applied.
|
|
|
|
- If you specify a datastore name, DRS Storage recommendation is disabled.
|
2015-03-31 16:06:20 +00:00
|
|
|
|
|
|
|
resourcepool
|
2015-03-31 18:25:53 +00:00
|
|
|
Enter the name of the resourcepool to which the new virtual machine should be
|
2015-04-02 10:56:49 +00:00
|
|
|
attached. This determines what compute resources will be available to the clone.
|
2015-04-02 10:28:32 +00:00
|
|
|
|
|
|
|
.. note::
|
|
|
|
|
|
|
|
- For a clone operation from a virtual machine, it will use the same resourcepool as
|
|
|
|
the original virtual machine unless specified.
|
|
|
|
- For a clone operation from a template to a virtual machine, specifying either this
|
|
|
|
or cluster is required. If both are specified, the resourcepool value will be used.
|
|
|
|
- For a clone operation to a template, this argument is ignored.
|
2015-04-01 18:42:58 +00:00
|
|
|
|
|
|
|
cluster
|
|
|
|
Enter the name of the cluster whose resource pool the new virtual machine should be
|
2015-04-02 10:56:49 +00:00
|
|
|
attached to.
|
2015-04-02 10:28:32 +00:00
|
|
|
|
|
|
|
.. note::
|
|
|
|
|
|
|
|
- For a clone operation from a virtual machine, it will use the same cluster\'s
|
|
|
|
resourcepool as the original virtual machine unless specified.
|
|
|
|
- For a clone operation from a template to a virtual machine, specifying either
|
|
|
|
this or resourcepool is required. If both are specified, the resourcepool value
|
|
|
|
will be used.
|
|
|
|
- For a clone operation to a template, this argument is ignored.
|
2015-03-31 16:06:20 +00:00
|
|
|
|
|
|
|
folder
|
2015-04-01 18:42:58 +00:00
|
|
|
Enter the name of the folder that will contain the new virtual machine.
|
2015-04-02 10:28:32 +00:00
|
|
|
|
|
|
|
.. note::
|
|
|
|
|
|
|
|
- For a clone operation from a VM/template, the new VM/template will be added to the
|
|
|
|
same folder that the original VM/template belongs to unless specified.
|
|
|
|
- If both folder and datacenter are specified, the folder value will be used.
|
2015-04-01 18:42:58 +00:00
|
|
|
|
|
|
|
datacenter
|
|
|
|
Enter the name of the datacenter that will contain the new virtual machine.
|
2015-04-02 10:28:32 +00:00
|
|
|
|
|
|
|
.. note::
|
|
|
|
|
|
|
|
- For a clone operation from a VM/template, the new VM/template will be added to the
|
|
|
|
same folder that the original VM/template belongs to unless specified.
|
|
|
|
- If both folder and datacenter are specified, the folder value will be used.
|
2015-03-31 16:06:20 +00:00
|
|
|
|
|
|
|
host
|
2015-04-02 10:56:49 +00:00
|
|
|
Enter the name of the target host where the virtual machine should be registered.
|
2015-04-02 10:28:32 +00:00
|
|
|
|
2015-03-31 18:25:53 +00:00
|
|
|
If not specified:
|
|
|
|
|
2015-04-02 10:28:32 +00:00
|
|
|
.. note::
|
2015-03-31 18:25:53 +00:00
|
|
|
|
2015-04-02 10:28:32 +00:00
|
|
|
- If resource pool is not specified, current host is used.
|
|
|
|
- If resource pool is specified, and the target pool represents a stand-alone
|
2015-03-31 18:25:53 +00:00
|
|
|
host, the host is used.
|
2015-04-02 10:28:32 +00:00
|
|
|
- If resource pool is specified, and the target pool represents a DRS-enabled
|
2015-03-31 18:25:53 +00:00
|
|
|
cluster, a host selected by DRS is used.
|
2015-04-02 10:28:32 +00:00
|
|
|
- If resource pool is specified and the target pool represents a cluster without
|
2015-03-31 18:25:53 +00:00
|
|
|
DRS enabled, an InvalidArgument exception be thrown.
|
2015-03-31 16:06:20 +00:00
|
|
|
|
|
|
|
template
|
2015-03-31 18:25:53 +00:00
|
|
|
Specifies whether the new virtual machine should be marked as a template or not.
|
2015-04-02 10:28:32 +00:00
|
|
|
Default is ``template: False``.
|
2015-03-31 16:06:20 +00:00
|
|
|
|
|
|
|
power_on
|
2015-04-02 10:28:32 +00:00
|
|
|
Specifies whether the new virtual machine should be powered on or not. If ``template: True``
|
|
|
|
is set, this field is ignored. Default is ``power_on: True``.
|