Replies: 1 comment
-
Did you ever find a better solution for this? I am trying to setup an upgrade process where a VM can be destroyed but a particular disk is detached and then reattached to the newly created VM |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm currently having to use a remote-exec null_resource to attach an existing disk to a new vm. I need to do this as the data on that disk need to persist the vm its finally attached to being deleted and recreated, the current solution is to create this disk against a placeholder VM and attach it after the actual vm is created using the code below
`
resource "null_resource" "attach_existing_disk" {
connection {
type = "ssh"
host = "XXX.XXX.XXX.XXX"
user = var.HOST_USER
password = var.HOST_PASSWORD
}
provisioner "remote-exec" {
inline = [
"qm set ${local.vm_id} -scsi1 hpool:vm-9001-disk-0"
]
}
}
`
Could we have a feature where this functionality could be incorperated into the disks block? This approach would be more robust than my current remote-exec approach
Beta Was this translation helpful? Give feedback.
All reactions