machine-drivers / docker-machine-driver-qemu

Docker machine driver for pure qemu/kvm - no libvirt
Apache License 2.0
56 stars 34 forks source link

Not working on Ubuntu 18.04 #5

Closed laszbalo closed 6 years ago

laszbalo commented 6 years ago
x@y:~/dev/docker-guide$ docker-machine create --driver=qemu myvm2
Running pre-create checks...
Creating machine...
(myvm2) Copying /home/x/.docker/machine/cache/boot2docker.iso to /home/x/.docker/machine/machines/myvm2/boot2docker.iso...
(myvm2) Creating SSH key...
(myvm2) Creating Disk image...
(myvm2) OUTPUT:
(myvm2) ERROR: qemu-img: Parameter 'size' expects a non-negative number below 2^64
(myvm2) Optional suffix k, M, G, T, P or E means kilo-, mega-, giga-, tera-, peta-
(myvm2) and exabytes, respectively.
(myvm2)
Error creating machine: Error in driver during machine creation: exit status 1
x@y:~$ qemu-img --version
qemu-img version 2.11.1(Debian 1:2.11+dfsg-1ubuntu7.4)
Copyright (c) 2003-2017 Fabrice Bellard and the QEMU Project developers

It seems that the version of qemu-img Ubuntu 18.04 comes with requires the disk size passed in with the postfix of 'M' instead of 'MB'.

E.g.:

if stdout, stderr, err := cmdOutErr("qemu-img", "resize", d.diskPath(), fmt.Sprintf("+%dM", size)); err != nil {
afbjorklund commented 6 years ago

Right, it seemed to be ignored even on 16:04

   size
       is the disk image size in bytes. Optional suffixes "k" or "K" (kilobyte, 1024) "M" (megabyte, 1024k) and "G" (gigabyte, 1024M) and T (terabyte, 1024G)
       are supported.  "b" is ignored.
afbjorklund commented 6 years ago

@laszbalo : please try again, and reopen if you find anything else