Skip to content
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 size create is only 1/10 of the original size when using qcow2 format #191

Open
ek9852 opened this issue Jul 23, 2017 · 1 comment
Open

Comments

@ek9852
Copy link

ek9852 commented Jul 23, 2017

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.

@zchee
Copy link
Member

zchee commented Jul 23, 2017

@ek9852 Ah, maybe good catch. Thanks.
I'll see that related code and fix it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants