vmware.rst 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759
  1. .. _cloud-getting-started-vmware:
  2. ===========================
  3. Getting Started With VMware
  4. ===========================
  5. .. versionadded:: 2015.5.4
  6. **Author**: Nitin Madhok <nmadhok@clemson.edu>
  7. The VMware cloud module allows you to manage VMware ESX, ESXi, and vCenter.
  8. Dependencies
  9. ============
  10. The vmware module for Salt Cloud requires the ``pyVmomi`` package, which is
  11. available at PyPI:
  12. https://pypi.org/project/pyvmomi/
  13. This package can be installed using `pip` or `easy_install`:
  14. .. code-block:: bash
  15. pip install pyvmomi
  16. easy_install pyvmomi
  17. .. note::
  18. Version 6.0 of pyVmomi has some problems with SSL error handling on certain
  19. versions of Python. If using version 6.0 of pyVmomi, the machine that you
  20. are running the proxy minion process from must have either Python 2.7.9 or
  21. newer This is due to an upstream dependency in pyVmomi 6.0 that is not supported
  22. in Python version 2.6 to 2.7.8. If the version of Python running the salt-cloud
  23. command is not in the supported range, you will need to install an earlier version
  24. of pyVmomi. See `Issue #29537`_ for more information.
  25. .. _Issue #29537: https://github.com/saltstack/salt/issues/29537
  26. .. note::
  27. pyVmomi doesn't expose the ability to specify the locale when connecting to
  28. VMware. This causes parsing issues when connecting to an instance of VMware
  29. running under a non-English locale. Until this feature is added upstream
  30. `Issue #38402`_ contains a workaround.
  31. .. _Issue #38402: https://github.com/saltstack/salt/issues/38402
  32. Configuration
  33. =============
  34. The VMware cloud module needs the vCenter or ESX/ESXi URL, username and password to be
  35. set up in the cloud configuration at
  36. ``/etc/salt/cloud.providers`` or ``/etc/salt/cloud.providers.d/vmware.conf``:
  37. .. code-block:: yaml
  38. my-vmware-config:
  39. driver: vmware
  40. user: 'DOMAIN\user'
  41. password: 'verybadpass'
  42. url: '10.20.30.40'
  43. vcenter01:
  44. driver: vmware
  45. user: 'DOMAIN\user'
  46. password: 'verybadpass'
  47. url: 'vcenter01.domain.com'
  48. protocol: 'https'
  49. port: 443
  50. vcenter02:
  51. driver: vmware
  52. user: 'DOMAIN\user'
  53. password: 'verybadpass'
  54. url: 'vcenter02.domain.com'
  55. protocol: 'http'
  56. port: 80
  57. esx01:
  58. driver: vmware
  59. user: 'admin'
  60. password: 'verybadpass'
  61. url: 'esx01.domain.com'
  62. .. note::
  63. Optionally, ``protocol`` and ``port`` can be specified if the vCenter
  64. server is not using the defaults. Default is ``protocol: https`` and
  65. ``port: 443``.
  66. .. note::
  67. .. versionchanged:: 2015.8.0
  68. The ``provider`` parameter in cloud provider configuration was renamed to ``driver``.
  69. This change was made to avoid confusion with the ``provider`` parameter that is
  70. used in cloud profile configuration. Cloud provider configuration now uses ``driver``
  71. to refer to the salt-cloud driver that provides the underlying functionality to
  72. connect to a cloud provider, while cloud profile configuration continues to use
  73. ``provider`` to refer to the cloud provider configuration that you define.
  74. .. _vmware-cloud-profile:
  75. Profiles
  76. ========
  77. Set up an initial profile at ``/etc/salt/cloud.profiles`` or
  78. ``/etc/salt/cloud.profiles.d/vmware.conf``:
  79. .. code-block:: yaml
  80. vmware-centos6.5:
  81. provider: vcenter01
  82. clonefrom: test-vm
  83. ## Optional arguments
  84. num_cpus: 4
  85. memory: 8GB
  86. devices:
  87. cd:
  88. CD/DVD drive 1:
  89. device_type: datastore_iso_file
  90. iso_path: "[nap004-1] vmimages/tools-isoimages/linux.iso"
  91. CD/DVD drive 2:
  92. device_type: client_device
  93. mode: atapi
  94. controller: IDE 2
  95. CD/DVD drive 3:
  96. device_type: client_device
  97. mode: passthrough
  98. controller: IDE 3
  99. disk:
  100. Hard disk 1:
  101. size: 30
  102. Hard disk 2:
  103. size: 20
  104. controller: SCSI controller 2
  105. Hard disk 3:
  106. size: 5
  107. controller: SCSI controller 3
  108. datastore: smalldiskdatastore
  109. network:
  110. Network adapter 1:
  111. name: 10.20.30-400-Test
  112. switch_type: standard
  113. ip: 10.20.30.123
  114. gateway: [10.20.30.110]
  115. subnet_mask: 255.255.255.128
  116. domain: example.com
  117. Network adapter 2:
  118. name: 10.30.40-500-Dev-DHCP
  119. adapter_type: e1000
  120. switch_type: distributed
  121. mac: '00:16:3e:e8:19:0f'
  122. Network adapter 3:
  123. name: 10.40.50-600-Prod
  124. adapter_type: vmxnet3
  125. switch_type: distributed
  126. ip: 10.40.50.123
  127. gateway: [10.40.50.110]
  128. subnet_mask: 255.255.255.128
  129. domain: example.com
  130. scsi:
  131. SCSI controller 1:
  132. type: lsilogic
  133. SCSI controller 2:
  134. type: lsilogic_sas
  135. bus_sharing: virtual
  136. SCSI controller 3:
  137. type: paravirtual
  138. bus_sharing: physical
  139. ide:
  140. IDE 2: {}
  141. IDE 3: {}
  142. domain: example.com
  143. dns_servers:
  144. - 123.127.255.240
  145. - 123.127.255.241
  146. - 123.127.255.242
  147. resourcepool: Resources
  148. cluster: Prod
  149. datastore: HUGE-DATASTORE-Cluster
  150. folder: Development
  151. datacenter: DC1
  152. host: c4212n-002.domain.com
  153. template: False
  154. power_on: True
  155. extra_config:
  156. mem.hotadd: 'yes'
  157. guestinfo.foo: bar
  158. guestinfo.domain: foobar.com
  159. guestinfo.customVariable: customValue
  160. annotation: Created by Salt-Cloud
  161. deploy: True
  162. customization: True
  163. private_key: /root/.ssh/mykey.pem
  164. ssh_username: cloud-user
  165. password: veryVeryBadPassword
  166. minion:
  167. master: 123.127.193.105
  168. file_map:
  169. /path/to/local/custom/script: /path/to/remote/script
  170. /path/to/local/file: /path/to/remote/file
  171. /srv/salt/yum/epel.repo: /etc/yum.repos.d/epel.repo
  172. hardware_version: 10
  173. image: centos64Guest
  174. #For Windows VM
  175. win_username: Administrator
  176. win_password: administrator
  177. win_organization_name: ABC-Corp
  178. plain_text: True
  179. win_installer: /root/Salt-Minion-2015.8.4-AMD64-Setup.exe
  180. win_user_fullname: Windows User
  181. ``provider``
  182. Enter the name that was specified when the cloud provider config was created.
  183. ``clonefrom``
  184. Enter the name of the VM/template to clone from. If not specified, the VM will be created
  185. without cloning.
  186. ``num_cpus``
  187. Enter the number of vCPUS that you want the VM/template to have. If not specified,
  188. the current VM/template\'s vCPU count is used.
  189. ``cores_per_socket``
  190. Enter the number of cores per vCPU that you want the VM/template to have. If not specified,
  191. this will default to 1.
  192. .. note::
  193. Cores per socket should be less than or equal to the total number of
  194. vCPUs assigned to the VM/template.
  195. .. versionadded:: 2016.11.0
  196. ``memory``
  197. Enter the memory size (in MB or GB) that you want the VM/template to have. If
  198. not specified, the current VM/template\'s memory size is used. Example
  199. ``memory: 8GB`` or ``memory: 8192MB``.
  200. ``devices``
  201. Enter the device specifications here. Currently, the following devices can be
  202. created or reconfigured:
  203. cd
  204. Enter the CD/DVD drive specification here. If the CD/DVD drive doesn\'t exist,
  205. it will be created with the specified configuration. If the CD/DVD drive
  206. already exists, it will be reconfigured with the specifications. The following
  207. options can be specified per CD/DVD drive:
  208. device_type
  209. Specify how the CD/DVD drive should be used. Currently supported types are
  210. ``client_device`` and ``datastore_iso_file``. Default is
  211. ``device_type: client_device``
  212. iso_path
  213. Enter the path to the iso file present on the datastore only if
  214. ``device_type: datastore_iso_file``. The syntax to specify this is
  215. ``iso_path: "[datastoreName] vmimages/tools-isoimages/linux.iso"``. This
  216. field is ignored if ``device_type: client_device``
  217. mode
  218. Enter the mode of connection only if ``device_type: client_device``. Currently
  219. supported modes are ``passthrough`` and ``atapi``. This field is ignored if
  220. ``device_type: datastore_iso_file``. Default is ``mode: passthrough``
  221. controller
  222. Specify the IDE controller label to which this drive should be attached.
  223. This should be specified only when creating both the specified IDE
  224. controller as well as the CD/DVD drive at the same time.
  225. disk
  226. Enter the disk specification here. If the hard disk doesn\'t exist, it will
  227. be created with the provided size. If the hard disk already exists, it will
  228. be expanded if the provided size is greater than the current size of the disk.
  229. size
  230. Enter the size of disk in GB
  231. thin_provision
  232. Specifies whether the disk should be thin provisioned or not. Default is ``thin_provision: False``.
  233. .. versionadded:: 2016.3.0
  234. eagerly_scrub
  235. Specifies whether the disk should be rewrite with zeros during thick provisioning or not.
  236. Default is ``eagerly_scrub: False``.
  237. .. versionadded:: 2018.3.0
  238. controller
  239. Specify the SCSI controller label to which this disk should be attached.
  240. This should be specified only when creating both the specified SCSI
  241. controller as well as the hard disk at the same time.
  242. datastore
  243. The name of a valid datastore should you wish the new disk to be in
  244. a datastore other than the default for the VM.
  245. network
  246. Enter the network adapter specification here. If the network adapter doesn\'t
  247. exist, a new network adapter will be created with the specified network name,
  248. type and other configuration. If the network adapter already exists, it will
  249. be reconfigured with the specifications. The following additional options can
  250. be specified per network adapter (See example above):
  251. name
  252. Enter the network name you want the network adapter to be mapped to.
  253. adapter_type
  254. Enter the network adapter type you want to create. Currently supported
  255. types are ``vmxnet``, ``vmxnet2``, ``vmxnet3``, ``e1000`` and ``e1000e``.
  256. If no type is specified, by default ``vmxnet3`` will be used.
  257. switch_type
  258. Enter the type of switch to use. This decides whether to use a standard
  259. switch network or a distributed virtual portgroup. Currently supported
  260. types are ``standard`` for standard portgroups and ``distributed`` for
  261. distributed virtual portgroups.
  262. ip
  263. Enter the static IP you want the network adapter to be mapped to. If the
  264. network specified is DHCP enabled, you do not have to specify this.
  265. gateway
  266. Enter the gateway for the network as a list. If the network specified
  267. is DHCP enabled, you do not have to specify this.
  268. subnet_mask
  269. Enter the subnet mask for the network. If the network specified is DHCP
  270. enabled, you do not have to specify this.
  271. domain
  272. Enter the domain to be used with the network adapter. If the network
  273. specified is DHCP enabled, you do not have to specify this.
  274. mac
  275. Enter the MAC for this network adapter. If not specified an address
  276. will be selected automatically.
  277. scsi
  278. Enter the SCSI controller specification here. If the SCSI controller doesn\'t exist,
  279. a new SCSI controller will be created of the specified type. If the SCSI controller
  280. already exists, it will be reconfigured with the specifications. The following
  281. additional options can be specified per SCSI controller:
  282. type
  283. Enter the SCSI controller type you want to create. Currently supported
  284. types are ``lsilogic``, ``lsilogic_sas`` and ``paravirtual``. Type must
  285. be specified when creating a new SCSI controller.
  286. bus_sharing
  287. Specify this if sharing of virtual disks between virtual machines is desired.
  288. The following can be specified:
  289. virtual
  290. Virtual disks can be shared between virtual machines on the same server.
  291. physical
  292. Virtual disks can be shared between virtual machines on any server.
  293. no
  294. Virtual disks cannot be shared between virtual machines.
  295. ide
  296. Enter the IDE controller specification here. If the IDE controller doesn\'t exist,
  297. a new IDE controller is created. If the IDE controller already exists,
  298. no further changes to it are made. The IDE controller specification is
  299. a dictionary.
  300. .. code-block:: yaml
  301. ide:
  302. IDE 2: {}
  303. ``domain``
  304. Enter the global domain name to be used for DNS. If not specified and if the VM name
  305. is a FQDN, ``domain`` is set to the domain from the VM name. Default is ``local``.
  306. ``dns_servers``
  307. Enter the list of DNS servers to use in order of priority.
  308. ``resourcepool``
  309. Enter the name of the resourcepool to which the new virtual machine should be
  310. attached. This determines what compute resources will be available to the clone.
  311. .. note::
  312. - For a clone operation from a virtual machine, it will use the same
  313. resourcepool as the original virtual machine unless specified.
  314. - For a clone operation from a template to a virtual machine, specifying
  315. either this or cluster is required. If both are specified, the resourcepool
  316. value will be used.
  317. - For a clone operation to a template, this argument is ignored.
  318. ``cluster``
  319. Enter the name of the cluster whose resource pool the new virtual machine should
  320. be attached to.
  321. .. note::
  322. - For a clone operation from a virtual machine, it will use the same cluster\'s
  323. resourcepool as the original virtual machine unless specified.
  324. - For a clone operation from a template to a virtual machine, specifying either
  325. this or resourcepool is required. If both are specified, the resourcepool
  326. value will be used.
  327. - For a clone operation to a template, this argument is ignored.
  328. ``datastore``
  329. Enter the name of the datastore or the datastore cluster where the virtual machine
  330. should be located on physical storage. If not specified, the current datastore is
  331. used.
  332. .. note::
  333. - If you specify a datastore cluster name, DRS Storage recommendation is
  334. automatically applied.
  335. - If you specify a datastore name, DRS Storage recommendation is disabled.
  336. ``folder``
  337. Enter the name of the folder that will contain the new virtual machine.
  338. .. note::
  339. - For a clone operation from a VM/template, the new VM/template will be added
  340. to the same folder that the original VM/template belongs to unless specified.
  341. - If both folder and datacenter are specified, the folder value will be used.
  342. ``datacenter``
  343. Enter the name of the datacenter that will contain the new virtual machine.
  344. .. note::
  345. - For a clone operation from a VM/template, the new VM/template will be added
  346. to the same folder that the original VM/template belongs to unless specified.
  347. - If both folder and datacenter are specified, the folder value will be used.
  348. ``host``
  349. Enter the name of the target host where the virtual machine should be registered.
  350. If not specified:
  351. .. note::
  352. - If resource pool is not specified, current host is used.
  353. - If resource pool is specified, and the target pool represents a stand-alone
  354. host, the host is used.
  355. - If resource pool is specified, and the target pool represents a DRS-enabled
  356. cluster, a host selected by DRS is used.
  357. - If resource pool is specified and the target pool represents a cluster without
  358. DRS enabled, an InvalidArgument exception be thrown.
  359. ``template``
  360. Specifies whether the new virtual machine should be marked as a template or not.
  361. Default is ``template: False``.
  362. ``power_on``
  363. Specifies whether the new virtual machine should be powered on or not. If
  364. ``template: True`` is set, this field is ignored. Default is ``power_on: True``.
  365. ``extra_config``
  366. Specifies the additional configuration information for the virtual machine. This
  367. describes a set of modifications to the additional options. If the key is already
  368. present, it will be reset with the new value provided. Otherwise, a new option is
  369. added. Keys with empty values will be removed.
  370. ``annotation``
  371. User-provided description of the virtual machine. This will store a message in the
  372. vSphere interface, under the annotations section in the Summary view of the virtual
  373. machine.
  374. ``deploy``
  375. Specifies if salt should be installed on the newly created VM. Default is ``True``
  376. so salt will be installed using the bootstrap script. If ``template: True`` or
  377. ``power_on: False`` is set, this field is ignored and salt will not be installed.
  378. ``wait_for_ip_timeout``
  379. When ``deploy: True``, this timeout determines the maximum time to wait for
  380. VMware tools to be installed on the virtual machine. If this timeout is
  381. reached, an attempt to determine the client's IP will be made by resolving
  382. the VM's name. By lowering this value a salt bootstrap can be fully
  383. automated for systems that are not built with VMware tools. Default is
  384. ``wait_for_ip_timeout: 1200``.
  385. ``customization``
  386. Specify whether the new virtual machine should be customized or not. If
  387. ``customization: False`` is set, the new virtual machine will not be customized.
  388. Default is ``customization: True``.
  389. ``private_key``
  390. Specify the path to the private key to use to be able to ssh to the VM.
  391. ``ssh_username``
  392. Specify the username to use in order to ssh to the VM. Default is ``root``
  393. ``password``
  394. Specify a password to use in order to ssh to the VM. If ``private_key`` is
  395. specified, you do not need to specify this.
  396. ``minion``
  397. Specify custom minion configuration you want the salt minion to have. A good example
  398. would be to specify the ``master`` as the IP/DNS name of the master.
  399. ``file_map``
  400. Specify file/files you want to copy to the VM before the bootstrap script is run
  401. and salt is installed. A good example of using this would be if you need to put
  402. custom repo files on the server in case your server will be in a private network
  403. and cannot reach external networks.
  404. ``hardware_version``
  405. Specify the virtual hardware version for the vm/template that is supported by the
  406. host.
  407. ``image``
  408. Specify the guest id of the VM. For a full list of supported values see the
  409. VMware vSphere documentation:
  410. https://code.vmware.com/apis?pid=com.vmware.wssdk.apiref.doc&release=vsphere-60&topic=vim.vm.GuestOsDescriptor.GuestOsIdentifier.html
  411. .. note::
  412. For a clone operation, this argument is ignored.
  413. ``win_username``
  414. Specify windows vm administrator account.
  415. .. note::
  416. Windows template should have "administrator" account.
  417. ``win_password``
  418. Specify windows vm administrator account password.
  419. .. note::
  420. During network configuration (if network specified), it is used to specify new administrator password for the machine.
  421. ``win_organization_name``
  422. Specify windows vm user's organization. Default organization name is Organization
  423. VMware vSphere documentation:
  424. https://www.vmware.com/support/developer/vc-sdk/visdk25pubs/ReferenceGuide/vim.vm.customization.UserData.html
  425. ``win_user_fullname``
  426. Specify windows vm user's fullname. Default fullname is "Windows User"
  427. VMware vSphere documentation:
  428. https://www.vmware.com/support/developer/vc-sdk/visdk25pubs/ReferenceGuide/vim.vm.customization.UserData.html
  429. ``plain_text``
  430. Flag to specify whether or not the password is in plain text, rather than encrypted.
  431. VMware vSphere documentation:
  432. https://www.vmware.com/support/developer/vc-sdk/visdk25pubs/ReferenceGuide/vim.vm.customization.Password.html
  433. ``win_installer``
  434. Specify windows minion client installer path
  435. ``win_run_once``
  436. Specify a list of commands to run on first login to a windows minion
  437. https://www.vmware.com/support/developer/vc-sdk/visdk25pubs/ReferenceGuide/vim.vm.customization.GuiRunOnce.html
  438. Cloning a VM
  439. ============
  440. Cloning VMs/templates is the easiest and the preferred way to work with VMs using the VMware driver.
  441. .. note::
  442. Cloning operations are unsupported on standalone ESXi hosts, a vCenter server will be required.
  443. Example of a minimal profile:
  444. .. code-block:: yaml
  445. my-minimal-clone:
  446. provider: vcenter01
  447. clonefrom: 'test-vm'
  448. When cloning a VM, all the profile configuration parameters are optional and the configuration gets inherited from the clone.
  449. Example to add/resize a disk:
  450. .. code-block:: yaml
  451. my-disk-example:
  452. provider: vcenter01
  453. clonefrom: 'test-vm'
  454. devices:
  455. disk:
  456. Hard disk 1:
  457. size: 30
  458. Depending on the configuration of the VM that is getting cloned, the disk in the resulting clone will differ.
  459. .. note::
  460. - If the VM has no disk named 'Hard disk 1' an empty disk with the specified size will be added to the clone.
  461. - If the VM has a disk named 'Hard disk 1' and the size specified is larger than the original disk, an empty disk with the specified size will be added to the clone.
  462. - If the VM has a disk named 'Hard disk 1' and the size specified is smaller than the original disk, an empty disk with the original size will be added to the clone.
  463. Example to reconfigure the memory and number of vCPUs:
  464. .. code-block:: yaml
  465. my-disk-example:
  466. provider: vcenter01
  467. clonefrom: 'test-vm'
  468. memory: 16GB
  469. num_cpus: 8
  470. Cloning a Template
  471. ==================
  472. Cloning a template works similar to cloning a VM except for the fact that a resource
  473. pool or cluster must be specified additionally in the profile.
  474. Example of a minimal profile:
  475. .. code-block:: yaml
  476. my-template-clone:
  477. provider: vcenter01
  478. clonefrom: 'test-template'
  479. cluster: 'Prod'
  480. Cloning from a Snapshot
  481. =======================
  482. .. versionadded:: 2016.3.5
  483. Cloning from a snapshot requires that one of the
  484. supported options be set in the cloud profile.
  485. Supported options are ``createNewChildDiskBacking``,
  486. ``moveChildMostDiskBacking``, ``moveAllDiskBackingsAndAllowSharing``
  487. and ``moveAllDiskBackingsAndDisallowSharing``.
  488. Example of a minimal profile:
  489. .. code-block:: yaml
  490. my-template-clone:
  491. provider: vcenter01
  492. clonefrom: 'salt_vm'
  493. snapshot:
  494. disk_move_type: createNewChildDiskBacking
  495. # these types are also supported
  496. # disk_move_type: moveChildMostDiskBacking
  497. # disk_move_type: moveAllDiskBackingsAndAllowSharing
  498. # disk_move_type: moveAllDiskBackingsAndDisallowSharing
  499. Creating a VM
  500. =============
  501. .. versionadded:: 2016.3.0
  502. Creating a VM from scratch means that more configuration has to be specified in the
  503. profile because there is no place to inherit configuration from.
  504. .. note::
  505. Unlike most cloud drivers that use prepared images, creating VMs using VMware
  506. cloud driver needs an installation method that requires no human interaction.
  507. For Example: preseeded ISO, kickstart URL or network PXE boot.
  508. Example of a minimal profile:
  509. .. code-block:: yaml
  510. my-minimal-profile:
  511. provider: esx01
  512. datastore: esx01-datastore
  513. resourcepool: Resources
  514. folder: vm
  515. .. note::
  516. The example above contains the minimum required configuration needed to create
  517. a VM from scratch. The resulting VM will only have 1 VCPU, 32MB of RAM and will
  518. not have any storage or networking.
  519. Example of a complete profile:
  520. .. code-block:: yaml
  521. my-complete-example:
  522. provider: esx01
  523. datastore: esx01-datastore
  524. resourcepool: Resources
  525. folder: vm
  526. num_cpus: 2
  527. memory: 8GB
  528. image: debian7_64Guest
  529. devices:
  530. scsi:
  531. SCSI controller 0:
  532. type: lsilogic_sas
  533. ide:
  534. IDE 0: {}
  535. IDE 1: {}
  536. disk:
  537. Hard disk 0:
  538. controller: 'SCSI controller 0'
  539. size: 20
  540. mode: 'independent_nonpersistent'
  541. cd:
  542. CD/DVD drive 0:
  543. controller: 'IDE 0'
  544. device_type: datastore_iso_file
  545. iso_path: '[esx01-datastore] debian-8-with-preseed.iso'
  546. network:
  547. Network adapter 0:
  548. name: 'VM Network'
  549. swith_type: standard
  550. .. note::
  551. Depending on VMware ESX/ESXi version, an exact match for ``image`` might not
  552. be available. In such cases, the closest match to another ``image`` should
  553. be used. In the example above, a Debian 8 VM is created using the image
  554. ``debian7_64Guest`` which is for a Debian 7 guest.
  555. Specifying disk backing mode
  556. ============================
  557. .. versionadded:: 2016.3.5
  558. Disk backing mode can now be specified when cloning a VM. This option
  559. can be set in the cloud profile as shown in example below:
  560. .. code-block:: yaml
  561. my-vm:
  562. provider: esx01
  563. datastore: esx01-datastore
  564. resourcepool: Resources
  565. folder: vm
  566. devices:
  567. disk:
  568. Hard disk 1:
  569. mode: 'independent_nonpersistent'
  570. size: 42
  571. Hard disk 2:
  572. mode: 'independent_nonpersistent'