diff --git a/builder/vsphere/driver/vm.go b/builder/vsphere/driver/vm.go index 9e48ba5af..0310af1c9 100644 --- a/builder/vsphere/driver/vm.go +++ b/builder/vsphere/driver/vm.go @@ -98,7 +98,7 @@ type NIC struct { } type CreateConfig struct { - DiskControllerType []string // example: "scsi", "pvscsi", "lsilogic" + DiskControllerType []string // example: "scsi", "pvscsi", "nvme", "lsilogic" Annotation string Name string @@ -841,7 +841,13 @@ func addDisk(_ *VCenterDriver, devices object.VirtualDeviceList, config *CreateC var controllers []types.BaseVirtualController for _, controllerType := range config.DiskControllerType { - device, err := devices.CreateSCSIController(controllerType) + var device types.BaseVirtualDevice + var err error + if controllerType == "nvme" { + device, err = devices.CreateNVMEController() + } else { + device, err = devices.CreateSCSIController(controllerType) + } if err != nil { return nil, err } diff --git a/builder/vsphere/iso/step_create.go b/builder/vsphere/iso/step_create.go index fe76da9c9..864f4a558 100644 --- a/builder/vsphere/iso/step_create.go +++ b/builder/vsphere/iso/step_create.go @@ -149,7 +149,10 @@ type CreateConfig struct { // here](https://code.vmware.com/apis/358/vsphere/doc/vim.vm.GuestOsDescriptor.GuestOsIdentifier.html) // for a full list of possible values. GuestOSType string `mapstructure:"guest_os_type"` - // Set VM disk controller type. Example `lsilogic`, pvscsi`, or `scsi`. Use a list to define additional controllers. Defaults to `lsilogic` + // Set VM disk controller type. Example `lsilogic`, `pvscsi`, `nvme`, or `scsi`. Use a list to define additional controllers. + // Defaults to `lsilogic`. See + // [SCSI, SATA, and NVMe Storage Controller Conditions, Limitations, and Compatibility](https://docs.vmware.com/en/VMware-vSphere/7.0/com.vmware.vsphere.vm_admin.doc/GUID-5872D173-A076-42FE-8D0B-9DB0EB0E7362.html#GUID-5872D173-A076-42FE-8D0B-9DB0EB0E7362) + // for additional details. DiskControllerType []string `mapstructure:"disk_controller_type"` // A collection of one or more disks to be provisioned along with the VM. Storage []DiskConfig `mapstructure:"storage"` diff --git a/website/pages/partials/builder/vsphere/iso/CreateConfig-not-required.mdx b/website/pages/partials/builder/vsphere/iso/CreateConfig-not-required.mdx index 7ff4577ee..a69992f04 100644 --- a/website/pages/partials/builder/vsphere/iso/CreateConfig-not-required.mdx +++ b/website/pages/partials/builder/vsphere/iso/CreateConfig-not-required.mdx @@ -9,7 +9,10 @@ here](https://code.vmware.com/apis/358/vsphere/doc/vim.vm.GuestOsDescriptor.GuestOsIdentifier.html) for a full list of possible values. -- `disk_controller_type` ([]string) - Set VM disk controller type. Example `lsilogic`, pvscsi`, or `scsi`. Use a list to define additional controllers. Defaults to `lsilogic` +- `disk_controller_type` ([]string) - Set VM disk controller type. Example `lsilogic`, `pvscsi`, `nvme`, or `scsi`. Use a list to define additional controllers. + Defaults to `lsilogic`. See + [SCSI, SATA, and NVMe Storage Controller Conditions, Limitations, and Compatibility](https://docs.vmware.com/en/VMware-vSphere/7.0/com.vmware.vsphere.vm_admin.doc/GUID-5872D173-A076-42FE-8D0B-9DB0EB0E7362.html#GUID-5872D173-A076-42FE-8D0B-9DB0EB0E7362) + for additional details. - `storage` ([]DiskConfig) - A collection of one or more disks to be provisioned along with the VM.