In the event that a storage pool has zfs.remove_snapshots set, the Terraform provider takes into account that this property is inherited (computed) to the storage volume after creation:
$ terraform apply
Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the
following symbols:
+ create
Terraform will perform the following actions:
# incus_storage_pool.test will be created
+ resource "incus_storage_pool" "test" {
+ config = {
+ "volume.zfs.remove_snapshots" = "true"
}
+ driver = "zfs"
+ name = "test"
+ project = "default"
# (1 unchanged attribute hidden)
}
# incus_storage_volume.test will be created
+ resource "incus_storage_volume" "test" {
+ config = {
+ "size" = "1GiB"
}
+ content_type = "block"
+ location = (known after apply)
+ name = "test"
+ pool = "test"
+ target = (known after apply)
+ type = "custom"
# (1 unchanged attribute hidden)
}
Plan: 2 to add, 0 to change, 0 to destroy.
Do you want to perform these actions?
Terraform will perform the actions described above.
Only 'yes' will be accepted to approve.
Enter a value: yes
incus_storage_pool.test: Creating...
incus_storage_pool.test: Creation complete after 2s [name=test]
incus_storage_volume.test: Creating...
incus_storage_volume.test: Creation complete after 0s [name=test]
Apply complete! Resources: 2 added, 0 changed, 0 destroyed.
$ terraform plan
incus_storage_pool.test: Refreshing state... [name=test]
incus_storage_volume.test: Refreshing state... [name=test]
No changes. Your infrastructure matches the configuration.
Terraform has compared your real infrastructure against your configuration and found no differences, so no changes are
needed.
This pull request fixes one of the problems of https://github.com/lxc/terraform-provider-incus/issues/43:
In the event that a storage pool has
zfs.remove_snapshots
set, the Terraform provider takes into account that this property is inherited (computed) to the storage volume after creation:Steps to reproduce: