Creates a new virtual machine in VMware vSphere and powers it on.

This task allows you to create a new virtual machine in a VMware vSphere environment. It requires the necessary credentials and configuration to connect to the vSphere server.

yaml
type: "io.kestra.plugin.ee.vmware.vcenter.CreateVm"

Create a new virtual machine in VMware vSphere

yaml
id: vsphere_create_vm
namespace: company.team

tasks:
  - id: create_vm
    type: io.kestra.plugin.ee.vmware.vcenter.CreateVm
    datacenter: "datacenter1"
    server: "localhost"
    username: "{{ secret('VMWARE_VCENTER_USERNAME') }}"
    password: "{{ secret('VMWARE_VCENTER_PASSWORD') }}"
    hostname: "localhost.localdomain"
    vmName: "vmware-vm"
    networkName: "VM Network"
    datastoreName: "datastore1"
    isoName: "ubuntu-22.04.5-desktop-amd64.iso"
Properties

The name of the data center

The name of the data center in which the virtual machine will be created.

The name of the host system (ESXi host).

The name of the host system where the virtual machine will be created.

The path to the ISO file in the datastore (inside the ESXi host).

The path to an ISO file to mount as a CD/DVD drive. The path is relative to the datastore root (e.g., 'ISOs/ubuntu.iso'). The ISO must be located on the specified 'datastoreName'.

The name of the network to connect the VM to (inside the ESXi host).

The name of the network that the virtual machine will be connected to. Types can be Standard/Distributed/Opaque).

The password for authentication.

The password used to authenticate with the VMware server.

The URL of the server.

The URL to connect to the VMwareserver. This is a FQDN or an IP address (eg: esxi.mycompany.com), so without any protocol nor port.

The username for authentication.

The username used to authenticate with the server. It could be something like '[email protected]' for vCenter or 'root' for ESXi.

The name of the virtual machine.

The number of CPUs for the VM.

The number of virtual CPUs to assign to the virtual machine.

The name of the datastore to use for the VM (inside the ESXi host).

The name of the datastore where the virtual machine's files will be stored.

The size of the disk in MB.

The size of the virtual machine's disk in megabytes.

The guest OS ID for the VM.

The identifier for the guest operating system that will run on the virtual machine (eg: ubuntu64Guest, rhel9_64Guest, windows11_64Guest, etc).

The size of the memory in MB.

The amount of memory in megabytes to assign to the virtual machine.

Default 443

The port for the connection.

The port to connect to the server. Default is 443.

The flag to whether power on or not the VM.

The option to let the user power on the VM or not.

The path to the trust store file.

The path to the trust store file containing certificates for secure connections. If not provided, an empty keystore will be created and the connection will be insecure.