Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Importing r/virtual_machine with SATA disks fails with "VM resource supports SCSI disks only" #1189

Closed
kradalby opened this issue Aug 29, 2020 · 17 comments · Fixed by #1629
Closed
Assignees
Labels
acknowledged Status: Issue or Pull Request Acknowledged area/storage Area: Storage area/vm Area: Virtual Machines bug Type: Bug size/s Relative Sizing: Small
Milestone

Comments

@kradalby
Copy link

Terraform Version

0.13.1

vSphere Provider Version

1.23.0

Affected Resource(s)

  • vsphere_virtual_machine

Terraform Configuration Files

resource "vsphere_virtual_machine" "vmac_terra" {
  name                  = "vmac"
  resource_pool_id      = vsphere_compute_cluster.terra.resource_pool_id
  guest_id              = "darwin16_64Guest"
  datastore_id          = data.vsphere_datastore.terra_fast.id
  num_cpus              = "2"
  memory                = "4096"
  scsi_controller_count = 0
  sata_controller_count = 1

  network_interface {
    network_id   = data.vsphere_network.terra.id
    adapter_type = "e1000e"
  }

  # cdrom {
  #   datastore_id = "datastore-10"
  #   path         = "ISO/mojave.iso"
  # }

  disk {
    label            = "disk0"
    size             = "140"
    thin_provisioned = true
    keep_on_remove   = false
    unit_number      = 0
    path             = "vmac/vmac.vmdk"
    controller_type  = "sata"
  }

  extra_config = {
    "smc.version" = "0"
  }

  lifecycle {
    ignore_changes = [
      disk,
      cdrom,
      resource_pool_id,
      clone[0].template_uuid,
    ]
  }
}

Debug Output

https://gist.github.com/kradalby/bbfd1c75fedced211e15d0390a5255d4

Expected Behavior

Virtual machine should have been imported to my TF state

Actual Behavior

Fails with:

Error: disk.0: unsupported controller type sata for disk sata:0:0. The VM resource supports SCSI disks only

Steps to Reproduce

Important Factoids

References

Support added in:

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment
@kradalby kradalby added the bug Type: Bug label Aug 29, 2020
@bill-rich bill-rich added size/s Relative Sizing: Small acknowledged Status: Issue or Pull Request Acknowledged labels Sep 1, 2020
@ssodhi
Copy link

ssodhi commented Nov 1, 2020

I am trying to import vm with ide disk (it's and old linux based legacy router) and get error:

Error: disk.0: unsupported controller type ide for disk ide:0:0. The VM resource supports SCSI disks only

Terraform v0.13.4
hashicorp/vsphere: version = "~> 1.24.2"

@krunal-git
Copy link

I am trying to import vm with ide disk (it's and old linux based legacy router) and get error:

Error: disk.0: unsupported controller type ide for disk ide:0:0. The VM resource supports SCSI disks only

Terraform v0.13.4
hashicorp/vsphere: version = "~> 1.24.2"
Were you able to fix this? how ?

@aloforte
Copy link

Still there when cloning a VM with IDE disk:
Terraform v0.15.5
hashicorp/vsphere version: 2.0.2

The error seems to come from https://github.com/hashicorp/terraform-provider-vsphere/blob/master/vsphere/internal/virtualdevice/virtual_machine_disk_subresource.go.

weird, since in theory ide disk support has been added with pull #1118

@dhekimian
Copy link
Contributor

Finally got around to testing #1118 and running into this issue.

Any chance to get this issue looked at?

@gitnetofr
Copy link

Hi !

Same problem here! 😞

Terraform version: v0.13.3
Vsphere provider version: v2.0.2

Did you find any workaround yet?
Thanks in advance.
Best regards.

@onurbrc
Copy link

onurbrc commented Dec 13, 2021

Hello guys, any news about this issue?
Thank you!!!

@dandunckelman
Copy link

We're getting the same issue when trying to use the EMC Isilon VM from here: https://downloads.emc.com/usa/Isilon/EMC_Isilon_OneFS_9.1.0.0_Simulator.zip

Any workaround?

@dhekimian
Copy link
Contributor

@tenthirtyam Any chance you could take a look at this and try to recreate using the EMC Isilon VM linked in the comment above? Looks like it might be quick to fix.

@tenthirtyam tenthirtyam added the needs-triage Status: Issue Needs Triage label Feb 14, 2022
@tenthirtyam tenthirtyam modified the milestones: v2.1.0, Research Feb 14, 2022
@tenthirtyam
Copy link
Collaborator

tenthirtyam commented Feb 15, 2022

I've added this to one of the milestones for triage.

Regarding IDE seen in the responses quoted below (@aloforte @ssodhi @krunal-git) did these VM imports have no CD-ROM? Currently ide 0:0 is currently reserved for the CD-ROM and might be the reason it's reporting the error. See GH-1354.

Still there when cloning a VM with IDE disk: Terraform v0.15.5 hashicorp/vsphere version: 2.0.2

The error seems to come from https://github.com/hashicorp/terraform-provider-vsphere/blob/master/vsphere/internal/virtualdevice/virtual_machine_disk_subresource.go.

weird, since in theory ide disk support has been added with pull #1118

and

I am trying to import vm with ide disk (it's and old linux based legacy router) and get error:

Error: disk.0: unsupported controller type ide for disk ide:0:0. The VM resource supports SCSI disks only

Terraform v0.13.4 hashicorp/vsphere: version = "~> 1.24.2"

@dhekimian
Copy link
Contributor

@tenthirtyam The EMC Isilon VM (https://downloads.emc.com/usa/Isilon/EMC_Isilon_OneFS_9.1.0.0_Simulator.zip) that encountered this error does not have a CD-ROM. This is a common use case for simulating a physical hardware storage environment where the OS is booted off a Compact Flash/SD card so it doesn't interfere with the SCSI controller. The EMC Isilon VM OVA is ~300mb making it an easy way to reproduce the issue in your lab.

error: disk.0: unsupported controller type ide for disk "Isilon 9.1.0.0/Isilon 9.1.0.0-000001.vmdk". Please use a template with SCSI disks only
[root@esx:/vmfs/volumes/EMC Isilon 9.1.0.0_1] cat EMC\ Isilon\ 9.1.0.0.vmx
.encoding = "UTF-8"
cleanShutdown = "TRUE"
config.readOnly = "FALSE"
config.version = "8"
displayName = "EMC Isilon 9.1.0.0"
evcCompatibilityMode = "TRUE"
floppy0.present = "FALSE"
guestOS = "freeBSD-64"
hpet0.present = "TRUE"
ide0:0.fileName = "EMC Isilon 9.1.0.0-000001.vmdk"
ide0:0.present = "TRUE"
ide0:0.redo = ""
memSize = "6144"
migrate.encryptionMode = "disabled"
migrate.hostLog = "EMC Isilon 9.1.0.0-7b8f3e10.hlog"
monitor.phys_bits_used = "40"
numa.autosize.cookie = "20001"
numa.autosize.vcpu.maxPerVirtualNode = "2"
numvcpus = "2"
nvram = "EMC Isilon 9.1.0.0.nvram"
pciBridge0.pciSlotNumber = "17"
pciBridge0.present = "TRUE"
pciBridge4.functions = "8"
pciBridge4.pciSlotNumber = "21"
pciBridge4.present = "TRUE"
pciBridge4.virtualDev = "pcieRootPort"
pciBridge5.functions = "8"
pciBridge5.pciSlotNumber = "22"
pciBridge5.present = "TRUE"
pciBridge5.virtualDev = "pcieRootPort"
pciBridge6.functions = "8"
pciBridge6.pciSlotNumber = "23"
pciBridge6.present = "TRUE"
pciBridge6.virtualDev = "pcieRootPort"
pciBridge7.functions = "8"
pciBridge7.pciSlotNumber = "24"
pciBridge7.present = "TRUE"
pciBridge7.virtualDev = "pcieRootPort"
powerType.powerOff = "hard"
powerType.reset = "hard"
scsi0.pciSlotNumber = "16"
scsi0.present = "TRUE"
scsi0.virtualDev = "lsilogic"
scsi0:0.deviceType = "scsi-hardDisk"
scsi0:0.fileName = "EMC Isilon 9.1.0.0_16-000001.vmdk"
scsi0:0.present = "TRUE"
scsi0:0.redo = ""
scsi0:1.deviceType = "scsi-hardDisk"
scsi0:1.fileName = "EMC Isilon 9.1.0.0_17-000001.vmdk"
scsi0:1.present = "TRUE"
scsi0:1.redo = ""
scsi0:2.deviceType = "scsi-hardDisk"
scsi0:2.fileName = "EMC Isilon 9.1.0.0_18-000001.vmdk"
scsi0:2.present = "TRUE"
scsi0:2.redo = ""
scsi0:3.deviceType = "scsi-hardDisk"
scsi0:3.fileName = "EMC Isilon 9.1.0.0_19-000001.vmdk"
scsi0:3.present = "TRUE"
scsi0:3.redo = ""
scsi0:4.deviceType = "scsi-hardDisk"
scsi0:4.fileName = "EMC Isilon 9.1.0.0_20-000001.vmdk"
scsi0:4.present = "TRUE"
scsi0:4.redo = ""
scsi0:5.deviceType = "scsi-hardDisk"
scsi0:5.fileName = "EMC Isilon 9.1.0.0_21-000001.vmdk"
scsi0:5.present = "TRUE"
scsi0:5.redo = ""
scsi1.pciSlotNumber = "32"
scsi1.present = "TRUE"
scsi1.virtualDev = "lsilogic"
scsi1:0.deviceType = "scsi-hardDisk"
scsi1:0.fileName = "EMC Isilon 9.1.0.0_11-000001.vmdk"
scsi1:0.present = "TRUE"
scsi1:0.redo = ""
scsi1:1.deviceType = "scsi-hardDisk"
scsi1:1.fileName = "EMC Isilon 9.1.0.0_12-000001.vmdk"
scsi1:1.present = "TRUE"
scsi1:1.redo = ""
scsi1:2.deviceType = "scsi-hardDisk"
scsi1:2.fileName = "EMC Isilon 9.1.0.0_13-000001.vmdk"
scsi1:2.present = "TRUE"
scsi1:2.redo = ""
scsi1:3.deviceType = "scsi-hardDisk"
scsi1:3.fileName = "EMC Isilon 9.1.0.0_14-000001.vmdk"
scsi1:3.present = "TRUE"
scsi1:3.redo = ""
scsi1:4.deviceType = "scsi-hardDisk"
scsi1:4.fileName = "EMC Isilon 9.1.0.0_15-000001.vmdk"
scsi1:4.present = "TRUE"
scsi1:4.redo = ""
scsi2.pciSlotNumber = "33"
scsi2.present = "TRUE"
scsi2.virtualDev = "lsilogic"
scsi2:0.deviceType = "scsi-hardDisk"
scsi2:0.fileName = "EMC Isilon 9.1.0.0_6-000001.vmdk"
scsi2:0.present = "TRUE"
scsi2:0.redo = ""
scsi2:1.deviceType = "scsi-hardDisk"
scsi2:1.fileName = "EMC Isilon 9.1.0.0_7-000001.vmdk"
scsi2:1.present = "TRUE"
scsi2:1.redo = ""
scsi2:2.deviceType = "scsi-hardDisk"
scsi2:2.fileName = "EMC Isilon 9.1.0.0_8-000001.vmdk"
scsi2:2.present = "TRUE"
scsi2:2.redo = ""
scsi2:3.deviceType = "scsi-hardDisk"
scsi2:3.fileName = "EMC Isilon 9.1.0.0_9-000001.vmdk"
scsi2:3.present = "TRUE"
scsi2:3.redo = ""
scsi2:4.deviceType = "scsi-hardDisk"
scsi2:4.fileName = "EMC Isilon 9.1.0.0_10-000001.vmdk"
scsi2:4.present = "TRUE"
scsi2:4.redo = ""
scsi3.pciSlotNumber = "34"
scsi3.present = "TRUE"
scsi3.virtualDev = "lsilogic"
scsi3:0.deviceType = "scsi-hardDisk"
scsi3:0.fileName = "EMC Isilon 9.1.0.0_1-000001.vmdk"
scsi3:0.present = "TRUE"
scsi3:0.redo = ""
scsi3:1.deviceType = "scsi-hardDisk"
scsi3:1.fileName = "EMC Isilon 9.1.0.0_2-000001.vmdk"
scsi3:1.present = "TRUE"
scsi3:1.redo = ""
scsi3:2.deviceType = "scsi-hardDisk"
scsi3:2.fileName = "EMC Isilon 9.1.0.0_3-000001.vmdk"
scsi3:2.present = "TRUE"
scsi3:2.redo = ""
scsi3:3.deviceType = "scsi-hardDisk"
scsi3:3.fileName = "EMC Isilon 9.1.0.0_4-000001.vmdk"
scsi3:3.present = "TRUE"
scsi3:3.redo = ""
scsi3:4.deviceType = "scsi-hardDisk"
scsi3:4.fileName = "EMC Isilon 9.1.0.0_5-000001.vmdk"
scsi3:4.present = "TRUE"
scsi3:4.redo = ""
softPowerOff = "TRUE"
svga.present = "TRUE"
toolScripts.afterPowerOn = "TRUE"
toolScripts.afterResume = "TRUE"
toolScripts.beforePowerOff = "TRUE"
toolScripts.beforeSuspend = "TRUE"
virtualHW.version = "8"
vmci0.id = "1152641124"
vmci0.pciSlotNumber = "38"
vmci0.present = "TRUE"
vmotion.checkpointFBSize = "4194304"

@dhekimian
Copy link
Contributor

While reviewing the code, I noticed the same check if ct != SubresourceControllerTypeSCSI is done in two places with slightly different error messages:

// Finally, we don't support non-SCSI (ie: SATA, IDE, NVMe) disks, so kick
// back an error if we see one of those.
ct, _, _, err := splitDevAddr(r.DevAddr())
if err != nil {
return fmt.Errorf("%s: error parsing device address after reading disk %q: %s", tr.Addr(), targetPath, err)
}
if ct != SubresourceControllerTypeSCSI {
return fmt.Errorf("%s: unsupported controller type %s for disk %q. Please use a template with SCSI disks only", tr.Addr(), ct, targetPath)
}

if ct != SubresourceControllerTypeSCSI {
return fmt.Errorf("disk.%d: unsupported controller type %s for disk %s. The VM resource supports SCSI disks only", i, ct, addr)
}

@tenthirtyam
Copy link
Collaborator

Yep! I'm quite familiar with the this virtual storage appliance as well some of the others (e.g. Dell EMC UnityVSA). I'll take a look at a reproduction with the Isilon OVA soon.

Ryan Johnson
Staff II Solutions Architect | VMware, Inc.

@tenthirtyam tenthirtyam self-assigned this Feb 15, 2022
@tenthirtyam
Copy link
Collaborator

tenthirtyam commented Feb 15, 2022

While reviewing the code, I noticed the same check if ct != SubresourceControllerTypeSCSI is done in two places with slightly different error messages:

// Finally, we don't support non-SCSI (ie: SATA, IDE, NVMe) disks, so kick
// back an error if we see one of those.
ct, _, _, err := splitDevAddr(r.DevAddr())
if err != nil {
return fmt.Errorf("%s: error parsing device address after reading disk %q: %s", tr.Addr(), targetPath, err)
}
if ct != SubresourceControllerTypeSCSI {
return fmt.Errorf("%s: unsupported controller type %s for disk %q. Please use a template with SCSI disks only", tr.Addr(), ct, targetPath)
}

if ct != SubresourceControllerTypeSCSI {
return fmt.Errorf("disk.%d: unsupported controller type %s for disk %s. The VM resource supports SCSI disks only", i, ct, addr)
}

Indeed, I was reviewing the same earlier. It needs to be triaged since all but NVME should be supported as I recall. (The latter being an existing enhancement request.)
_
Ryan

@tenthirtyam
Copy link
Collaborator

While reviewing the code, I noticed the same check if ct != SubresourceControllerTypeSCSI is done in two places with slightly different error messages:

// Finally, we don't support non-SCSI (ie: SATA, IDE, NVMe) disks, so kick
// back an error if we see one of those.
ct, _, _, err := splitDevAddr(r.DevAddr())
if err != nil {
return fmt.Errorf("%s: error parsing device address after reading disk %q: %s", tr.Addr(), targetPath, err)
}
if ct != SubresourceControllerTypeSCSI {
return fmt.Errorf("%s: unsupported controller type %s for disk %q. Please use a template with SCSI disks only", tr.Addr(), ct, targetPath)
}

if ct != SubresourceControllerTypeSCSI {
return fmt.Errorf("disk.%d: unsupported controller type %s for disk %s. The VM resource supports SCSI disks only", i, ct, addr)
}

After some addition code review, it does appear that these are the likely pointers to the issue and that these were not completed lifted as a part of #1118.

Ryan

@tenthirtyam tenthirtyam added area/vm Area: Virtual Machines area/storage Area: Storage labels Feb 22, 2022
@tenthirtyam tenthirtyam modified the milestones: Research, v2.2.0 Feb 24, 2022
@tenthirtyam tenthirtyam changed the title Importing VM's with SATA disks fails with "VM resource supports SCSI disks only" Importing r/virtual_machine with SATA disks fails with "VM resource supports SCSI disks only" Feb 28, 2022
@tenthirtyam
Copy link
Collaborator

Hi @dhekimian 👋 -

I took a moment this morning to look at the use of the Dell EMC Isilon VSA example for an import. A terraform import of this virtual appliance fails first because ide0:0 is currently reserved as discussed in GH-1354.

error: disk.0: unsupported controller type ide for disk "Isilon 9.1.0.0/Isilon 9.1.0.0-000001.vmdk". Please use a template with SCSI disks only
[root@esx:/vmfs/volumes/EMC Isilon 9.1.0.0_1] cat EMC\ Isilon\ 9.1.0.0.vmx
.encoding = "UTF-8"
cleanShutdown = "TRUE"
config.readOnly = "FALSE"
config.version = "8"
displayName = "EMC Isilon 9.1.0.0"
evcCompatibilityMode = "TRUE"
floppy0.present = "FALSE"
guestOS = "freeBSD-64"
hpet0.present = "TRUE"
ide0:0.fileName = "EMC Isilon 9.1.0.0-000001.vmdk" <------| 
ide0:0.present = "TRUE"                            <------|  ide0:0 - See GH-1354
ide0:0.redo = ""                                   <------|

For this issue, I'll test with a custom virtual machine / appliance examples to see if I can narrow down the issue.

Ryan Johnson
Staff II Solutions Architect | VMware, Inc.

tenthirtyam added a commit that referenced this issue Mar 21, 2022
Updates the `DiskCloneValidateOperation` and `DiskImportOperation` functions in `virtual_machine_disk_subresource` to add support for SATA and IDE controllers and disks.  #1189

Signed-off-by: Ryan Johnson <[email protected]>
@tenthirtyam
Copy link
Collaborator

Pull request #1629 has been submitted for review which updates the DiskCloneValidateOperation and DiskImportOperation functions in r/virtual_machine_disk_subresource to add support for SATA and IDE controllers and disks (alongside existing SCSI support.)

Marked for Milestone v2.2.0.

Ryan Johnson
Staff II Solutions Architect | VMware, Inc.

tenthirtyam added a commit that referenced this issue Mar 21, 2022
Updates the `DiskCloneValidateOperation` and `DiskImportOperation` functions in `virtual_machine_disk_subresource` to add support for SATA and IDE controllers and disks. #1189

Signed-off-by: Ryan Johnson <[email protected]>
appilon pushed a commit that referenced this issue Mar 22, 2022
Updates the `DiskCloneValidateOperation` and `DiskImportOperation` functions in `virtual_machine_disk_subresource` to add support for SATA and IDE controllers and disks.  #1189

Signed-off-by: Ryan Johnson <[email protected]>
appilon pushed a commit that referenced this issue Mar 22, 2022
Updates the `DiskCloneValidateOperation` and `DiskImportOperation` functions in `virtual_machine_disk_subresource` to add support for SATA and IDE controllers and disks. #1189

Signed-off-by: Ryan Johnson <[email protected]>
@github-actions
Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 22, 2022
@tenthirtyam tenthirtyam removed the needs-triage Status: Issue Needs Triage label Jun 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
acknowledged Status: Issue or Pull Request Acknowledged area/storage Area: Storage area/vm Area: Virtual Machines bug Type: Bug size/s Relative Sizing: Small
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants