-
Notifications
You must be signed in to change notification settings - Fork 550
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
[3.0.1-rc6] GRPCProvider error after upgrading PVE from 7.4 to 8.3 #1237
Comments
@iazamat16 the |
I provided tfstate "cores": 8,
"cpu_type": "host",
"default_ipv4_address": null,
"define_connection_info": true,
"desc": "k4w1",
"disk": [
{
"cache": "writeback",
"discard": true,
"file": "vm-119-disk-0",
"format": "raw",
"iothread": false,
"mbps": 0,
"mbps_rd": 0,
"mbps_rd_max": 0,
"mbps_wr": 0,
"mbps_wr_max": 0,
"media": "",
"replicate": false,
"size": "100G",
"slot": "scsi0",
"emulatessd": false,
"storage": "ceph3",
"storage_type": "rbd",
"type": "cloudinit",
"volume": "ceph3:vm-119-disk-0"
}
],
"disk_gb": 0,
"force_create": false,
"force_recreate_on_change_of": null,
"full_clone": true,
"guest_agent_ready_timeout": 100,
"hagroup": "",
"hastate": "",
"hotplug": "network,disk,usb",
"id": "prox61/qemu/119", terraform plan # module.proxmox_vm.proxmox_vm_qemu.cloudinit-test["k4w1"] will be updated in-place
~ resource "proxmox_vm_qemu" "cloudinit-test" {
+ ciupgrade = false
id = "prox52/qemu/119"
name = "k4w1"
+ skip_ipv4 = false
+ skip_ipv6 = false
tags = null
# (54 unchanged attributes hidden)
~ disk {
+ cache = "writeback"
id = 0
+ size = "100G"
~ slot = "ide2" -> "scsi0"
# (26 unchanged attributes hidden)
}
- disk {
- backup = true -> null
- cache = "writeback" -> null
- discard = true -> null
- emulatessd = false -> null
- format = "raw" -> null
- id = 0 -> null
- iops_r_burst = 0 -> null
- iops_r_burst_length = 0 -> null
- iops_r_concurrent = 0 -> null
- iops_wr_burst = 0 -> null
- iops_wr_burst_length = 0 -> null
- iops_wr_concurrent = 0 -> null
- iothread = false -> null
- linked_disk_id = -1 -> null
- mbps_r_burst = 0 -> null
- mbps_r_concurrent = 0 -> null
- mbps_wr_burst = 0 -> null
- mbps_wr_concurrent = 0 -> null
- passthrough = false -> null
- readonly = false -> null
- replicate = true -> null
- size = "100G" -> null
- slot = "scsi0" -> null
- storage = "ceph3" -> null
- type = "disk" -> null
# (5 unchanged attributes hidden)
}
Plan: 0 to add, 3 to change, 0 to destroy.
╷
│ Warning: Failed to decode resource from state
│
│ Error decoding "module.proxmox_vm.proxmox_vm_qemu.cloudinit-test[\"k4w1\"]" from prior state: unsupported attribute
│ "file" Why I got two overriding configurations? ~ slot = "ide2" -> "scsi0"
- slot = "scsi0" -> null But when I provide disk block in module like this, got this kind of error: │ Error: Missing required argument
│
│ on ../modules/proxmox-vm/main.tf line 38, in resource "proxmox_vm_qemu" "cloudinit-test":
│ 38: disk {
│
│ The argument "slot" is required, but no definition was found.
╵
╷
│ Error: Unsupported block type
│
│ on ../modules/proxmox-vm/main.tf line 46, in resource "proxmox_vm_qemu" "cloudinit-test":
│ 46: scsi {
│
│ Blocks of type "scsi" are not expected here. How to properly add disk block at state file? |
@iazamat16 the reason for the error is that we have |
@Tinyblargon thank you for your help But I still don't get it, how do I need to convert disk block at terraform state to achieve not recreating resources I changed the disk block declaration in the module as follows disks {
scsi {
scsi0 {
disk {
backup = var.disks[each.key].disk_slot
emulatessd = var.disks[each.key].disk_emulatessd
iothread = var.disks[each.key].disk_iothread
replicate = var.disks[each.key].disk_replicate
storage = var.disks[each.key].disk_storage
}
}
}
} Tried to edit disk block at state like this "disks": {
"scsi": {
"scsi0": {
"disk": {
"cache": "none",
"file": "vm-103-disk-0",
"format": "raw",
"iothread": false,
"mbps": 0,
"mbps_rd": 0,
"mbps_rd_max": 0,
"mbps_wr": 0,
"mbps_wr_max": 0,
"media": "",
"replicate": false,
"size": "200G",
"slot": "scsi0",
"emulatessd": false,
"storage": "local-lvm",
"storage_type": "lvmthin",
"type": "cloudinit",
"volume": "local-lvm:vm-103-disk-0"
}
}
}
}, Can you send a piece of terraform state file for example? |
@iazamat16 Do consider that it will always say it's gonna delete disks. There is a protection flag in the provider and PVE, setting it to true disallows deletion of disks. Just to be safe, I'd set it in Terraform and PVE. Please first test this on a backup of the vm. |
Thanks, I will add a protection flag before I do But still, could you show, explain how to correctly declare resources according to the new scheme, especially the disk block |
Previously we used proxmox 7.4.19 with telmate 2.19.10
Then we upgraded proxmox hardware to pve 8.3.2
Had a problems with old provider version. Updated provider to the latest (
3.0.1-rc6
) version.Fixed misconfigurations caused by versions differences. Also removed some breaking properties mentioned at 3.0.1-rc2
Now, after
terraform plan
receiving this kind of error:modules/proxmox-vm/main.tf
Piece of state file
How can I achieve:
Plan: 0 to add, 0 to change, 0 to destroy.
So that my resources won't be recreated.thanks in advance
The text was updated successfully, but these errors were encountered: