-
-
Notifications
You must be signed in to change notification settings - Fork 108
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
Disk resize for VM not updated in terraform state #1271
Comments
One question about the step 1: have you cloned the VM from a template / another VM, or created from scratch? |
It is a full clone (not a linked clone) from a template. I'm also not sure if relevant, but the template uses an image of Ubuntu's cloud-init images. |
@mattburchett You need to install and enable, qemu-guest-agent to target VM, because after resizing the VM requires a reboot, and without an agent this is not possible even from the interface proxmox. Install you may do with cloud-init, and add agent = true to target VM |
It does have qemu-guest-agent enabled. And my Terraform config: resource "proxmox_virtual_environment_vm" "vms" {
for_each = local.pve-hosts
name = each.key
description = "Managed by Terraform"
node_name = each.value.target-node
vm_id = split(".", each.value.ip.address)[3]
agent {
enabled = true
}
clone {
datastore_id = each.value.hardware.storage
retries = 10
node_name = "lrhq-pve"
vm_id = each.value.template
}
cpu {
cores = each.value.hardware.cores
sockets = 1
type = "host"
}
disk {
datastore_id = each.value.hardware.storage
interface = "virtio0"
size = each.value.hardware.disk_size
}
initialization {
datastore_id = each.value.hardware.storage
ip_config {
ipv4 {
address = "${each.value.ip.address}/${each.value.ip.cidr}"
gateway = each.value.ip.gw
}
}
user_data_file_id = proxmox_virtual_environment_file.ubuntu_cloud_config[each.key].id
}
lifecycle {
ignore_changes = [
initialization[0].user_data_file_id
]
}
memory {
dedicated = each.value.hardware.memory
}
network_device {}
on_boot = true
operating_system {
type = "l26"
}
serial_device {}
depends_on = [cloudflare_record.proxmox-pve-dns]
} |
@mattburchett Please check status of agent on this VM ? |
I did restart it a moment ago, because it was having some errors for And after the restart, a
|
@mattburchett Hmm... I can't reproduce this issue in my simple test. 🤔 |
Yeah, I think this might be a proxmox bug. It still happened on my test VM after an update to 8.2.2 (from 8.0). I found someone with the same issue, but with a LXC container: https://bugzilla.proxmox.com/show_bug.cgi?id=305 I gave some information over there to see if it's a bug on their end. |
Hmm... I've tried your exact template & vm on both ZFS and LVM storages, and had no issues. PVE v8.2.2 as well. Perhaps something specific to your ZFS config? |
I'm not certain honestly. I don't think I've done anything specific with ZFS on Proxmox. It's pretty much a bog-standard single-node install with ZFS in a RAIDZ2, with ZFS on root, all done through the installer. I do have some server setup that is done via Ansible, but nothing that messes with the storage arrays. It pretty much just installs monitoring and sets up my shell. |
@mattburchett Is there is hardwar RAID controller where ZFS runs on? If so this is not supported and recommended by ZFS because ZFS "likes" to see all disks directly and some some features even require this, e.g. to protect against silent bitrot. |
Describe the bug
After increasing the disk size in Terraform, the state still contains the old values and tries to increase again.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Terraform's state should have the new value after applying.
Log
Let me know if I can provide any more information that would be useful.
The text was updated successfully, but these errors were encountered: