scsi0 - cloud-init drive is already attached at 'ide0

lethargos

Well-Known Member
Jun 10, 2017
142
6
58
74
I'm provisioning a virtual machine from a packer clone using terraform. My question is not related to terraform, this is just the context, but I eventually end up getting this error:
```
update VM 108: -agent 1 -bios seabios -boot c -bootdisk scsi0 -cicustom user=cloudinit:snippets/cloud_init_ub2204-example.yaml -cores 4 -cpu kvm64 -hotplug network,disk,memory,cpu -ipconfig0 ip=10.16.16.20/24,gw=10.16.16.254 -kvm 1 -memory 12288 -name example-work -nameserver 10.88.88.126 -net0 virtio=DA:C3:B5:CA:07:8C,bridge=vmbr1 -numa 1 -onboot 0 -scsi0 local-lvm:vm-108-cloudinit,size=100G -scsihw virtio-scsi-pci -searchdomain domain.com -serial0 socket -sockets 1 -tablet 1
TASK ERROR: scsi0 - cloud-init drive is already attached at 'ide0'
```
which I didn't get before and the first thing I'd like to understand is how this error can be interpreted. This doesn't make a lot of sense to me. Is it trying to attach the cloud-init drive to scsi0, but it cannot, because it'a already attached at ide0? scsi0 is the hard disk itself, so I'm not sure what this is getting at.

I'm using Proxmox 7.4-3 (terraform 1.5.3 with proxmox plugin telmate/proxmox 2.9.14)
 
Switching to telmate/proxmox 2.9.11 works in that the error is ignored and the provisioning works.

Indeed, as far as I can understand, terraform tries to attach the cloud drive to scsi0, and it fails to do so because it says that it's already attached to ide0. And I've no idea where this is configured :) This doesn't necessarily seems to be a proxmox question, but it's always hard to get answers at the line between different technologies.
 
I'm provisioning a virtual machine from a packer clone using terraform. My question is not related to terraform, this is just the context, but I eventually end up getting this error:
```
update VM 108: -agent 1 -bios seabios -boot c -bootdisk scsi0 -cicustom user=cloudinit:snippets/cloud_init_ub2204-example.yaml -cores 4 -cpu kvm64 -hotplug network,disk,memory,cpu -ipconfig0 ip=10.16.16.20/24,gw=10.16.16.254 -kvm 1 -memory 12288 -name example-work -nameserver 10.88.88.126 -net0 virtio=DA:C3:B5:CA:07:8C,bridge=vmbr1 -numa 1 -onboot 0 -scsi0 local-lvm:vm-108-cloudinit,size=100G -scsihw virtio-scsi-pci -searchdomain domain.com -serial0 socket -sockets 1 -tablet 1
TASK ERROR: scsi0 - cloud-init drive is already attached at 'ide0'
```
which I didn't get before and the first thing I'd like to understand is how this error can be interpreted. This doesn't make a lot of sense to me. Is it trying to attach the cloud-init drive to scsi0, but it cannot, because it'a already attached at ide0? scsi0 is the hard disk itself, so I'm not sure what this is getting at.

I'm using Proxmox 7.4-3 (terraform 1.5.3 with proxmox plugin telmate/proxmox 2.9.14)
This is probably because you have the following set in your code:

Code:
bootdisk = "scsi0"

Just remove that line.
I am learning terraform as well and I had the error also ;)

Make sure you define the SCSI controller also. If you want to use iothread=1 make sure to declare the following scsi controller:

Code:
  scsihw = "virtio-scsi-single"
else remove iothread=1 so it default to 0 and use
Code:
  scsihw = "virtio-scsi-pci"


This was the final piece of the puzzle for me. I noticed during the "configure" process that he would set the default LSI scsi controller there. Once I noticed and fixed that everything worked perfectly.

Might be useful for others that arrive here by googling that "scsi0 - cloud-init drive is already attached at 'ide0'" :cool:

Hope it helps.
Good luck and have fun!
S.

 
mmm I seem to get it also again now, when I use higher count, seem like a timing/processing order issue or so. will test with 2.9.11 also
 
UPDATE:
Using latest telmate v2.9.14
For anyone arriving on this forum post, this is related to
https://github.com/Telmate/terraform-provider-proxmox/issues/704

There are several work arounds.
For me it worked by removing the cloud-init drive from the proxmox template and let terraform create the cloud-init drive itself by justr defining the storage you want to use for it.

example:
Code:
cloudinit_cdrom_storage = "local-zfs"
 
I fixed this by using scsi1 for the cloudinit drive instead of ide or sata
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!