disk size create is only 1/10 of the original size when using qcow2 format
ek9852 opened this issue · 1 comments
ek9852 commented
When create a machine with raw disk, the disk size is correct (in terms of MB)
But when using qcow2 format, the disk size is only 1/10 of the expected size.
In the code:
func (d *Driver) generateQcow2Image(size int64) error {
diskPath := filepath.Join(d.ResolveStorePath("."), d.MachineName+".qcow2")
opts := &qcow2.Opts{
Filename: diskPath,
Size: d.DiskSize * 107374,
Fmt: qcow2.DriverQCow2,
ClusterSize: 65536,
Preallocation: qcow2.PREALLOC_MODE_OFF,
Encryption: false,
LazyRefcounts: true,
}
It magically multiply by 107374 instead of 1048576.