Closed arunnalpet closed 3 years ago
You will need to use the base_volume_id (https://github.com/dmacvicar/terraform-provider-libvirt/blob/master/website/docs/r/volume.html.markdown#argument-reference)
resource "libvirt_volume" "base-centos7-qcow2" {
name = "CentOS-7-x86_64-GenericCloud.qcow2"
pool = "images"
source = "./CentOS-7-x86_64-GenericCloud.qcow2"
format = "qcow2"
}
resource "libvirt_volume" "centos7-qcow2" {
name = "centos7.qcow2"
pool = "images"
format = "qcow2"
size = var.diskBytes
base_volume_id = libvirt_volume.base-centos7-qcow2
}
One small correction. You are missing the .id
...
base_volume_id = libvirt_volume.base-centos7-qcow2.id
...
Thanks, this approach works fine!
Hi, How can we specify size for OS volume? Currently its documented that, OS volume will assume the size of disk image.
I am installing some software on top of this OS volume, which has a per-requisite that OS volume should be 40gb at least.
Example:
In the above sample, specifying 'size' attribute will fail, because we have specified 'source' already. So the size of this volume will be just around 800MB, while I want it to be atleast 40Gb. How can I achieve this?