ubuntu-kvm-builder falhando com “/ dev / mapper / loop0p1 não existe”

0

Usando o ubuntu 15.10, Eu estou simplesmente tentando criar uma VM usando o kvm e segui algumas instruções na web, mas sem sucesso. Parece falhar ao executar mkfs.ext4 com este erro: The file /dev/mapper/loop0p1 does not exist and no size was specified.

Eu instalei estes:

sudo apt-get install qemu-kvm libvirt-bin ubuntu-vm-builder bridge-utils virt-manager

Comando

ubuntu-vm-builder kvm trusty \
                  --domain newvm \
                  --dest newvm \
                  --arch i386 \
                  --hostname hostnameformyvm \
                  --mem 256 \
                  --user john \
                  --pass doe \
                  --bridge br0 \
                  --dns 8.8.8.8 \
                  --mirror http://us.archive.ubuntu.com/ubuntu \
                  --components main,universe \
                  --addpkg acpid \
                  --addpkg vim \
                  --addpkg openssh-server \
                  --libvirt qemu:///system ;

Saída

2016-02-05 13:04:27,082 INFO    : logging to file: /tmp/tmpODnkhw
2016-02-05 13:04:27,161 INFO    : Calling hook: preflight_check
2016-02-05 13:04:27,164 INFO    : Calling hook: set_defaults
2016-02-05 13:04:27,165 INFO    : Calling hook: bootstrap
2016-02-05 13:09:00,044 INFO    : Calling hook: configure_os
Extracting templates from packages: 100%
2016-02-05 13:09:58,368 INFO    : invoke-rc.d: policy-rc.d denied execution of start.
2016-02-05 13:09:59,776 INFO    : Creating SSH2 RSA key; this may take some time ...
2016-02-05 13:10:00,332 INFO    : Creating SSH2 DSA key; this may take some time ...
2016-02-05 13:10:00,338 INFO    : Creating SSH2 ECDSA key; this may take some time ...
2016-02-05 13:10:00,352 INFO    : Creating SSH2 ED25519 key; this may take some time ...
2016-02-05 13:10:01,404 INFO    : invoke-rc.d: policy-rc.d denied execution of start.
2016-02-05 13:10:13,530 INFO    :
2016-02-05 13:10:13,531 INFO    : Current default time zone: 'Etc/UTC'
2016-02-05 13:10:13,533 INFO    : Local time is now:      Fri Feb  5 18:10:13 UTC 2016.
2016-02-05 13:10:13,534 INFO    : Universal Time is now:  Fri Feb  5 18:10:13 UTC 2016.
2016-02-05 13:10:13,534 INFO    :
Extracting templates from packages: 100%
2016-02-05 13:10:53,208 INFO    :
2016-02-05 13:10:53,208 INFO    : Current default time zone: 'Etc/UTC'
2016-02-05 13:10:53,210 INFO    : Local time is now:      Fri Feb  5 18:10:53 UTC 2016.
2016-02-05 13:10:53,212 INFO    : Universal Time is now:  Fri Feb  5 18:10:53 UTC 2016.
2016-02-05 13:10:53,212 INFO    : Run 'dpkg-reconfigure tzdata' if you wish to change it.
2016-02-05 13:10:53,212 INFO    :
2016-02-05 13:10:56,277 INFO    : invoke-rc.d: policy-rc.d denied execution of stop.
2016-02-05 13:11:47,834 INFO    : invoke-rc.d: policy-rc.d denied execution of stop.
2016-02-05 13:11:51,507 INFO    : invoke-rc.d: policy-rc.d denied execution of start.
2016-02-05 13:11:52,909 INFO    : invoke-rc.d: policy-rc.d denied execution of restart.
2016-02-05 13:12:01,982 INFO    : invoke-rc.d: policy-rc.d denied execution of start.
2016-02-05 13:12:05,980 INFO    : invoke-rc.d: policy-rc.d denied execution of restart.
2016-02-05 13:12:20,074 INFO    : Cleaning up
2016-02-05 13:12:20,085 INFO    : Calling hook: preflight_check
2016-02-05 13:12:20,609 INFO    : Calling hook: configure_networking
2016-02-05 13:12:20,656 INFO    : Calling hook: configure_mounting
2016-02-05 13:12:20,665 INFO    : Calling hook: mount_partitions
2016-02-05 13:12:20,665 INFO    : Mounting target filesystems
2016-02-05 13:12:20,665 INFO    : Creating disk image: "/tmp/tmpMijS7P" of size: 5120MB
2016-02-05 13:12:20,956 INFO    : Adding partition table to disk image: /tmp/tmpMijS7P
2016-02-05 13:12:21,104 INFO    : Adding type 4 partition to disk image: /tmp/tmpMijS7P
2016-02-05 13:12:21,104 INFO    : Partition at beginning of disk - reserving first cylinder
2016-02-05 13:12:21,111 INFO    : Warning: The resulting partition is not properly aligned for best performance.
2016-02-05 13:12:21,164 INFO    : Adding type 3 partition to disk image: /tmp/tmpMijS7P
2016-02-05 13:12:21,171 INFO    : [0] ../../libparted/filesys.c:148 (ped_file_system_type_get): File system alias linux-swap(new) is deprecated
2016-02-05 13:12:21,205 INFO    : Creating loop devices corresponding to the created partitions
2016-02-05 13:12:21,306 INFO    : Creating file systems
2016-02-05 13:12:21,365 INFO    : mke2fs 1.42.12 (29-Aug-2014)
2016-02-05 13:12:21,365 INFO    : The file /dev/mapper/loop0p1 does not exist and no size was specified.
2016-02-05 13:12:21,367 INFO    : Cleaning up
2016-02-05 13:12:24,493 ERROR   : Process (['mkfs.ext4', '-F', '/dev/mapper/loop0p1']) returned 1. stdout: , stderr: mke2fs 1.42.12 (29-Aug-2014)
The file /dev/mapper/loop0p1 does not exist and no size was specified.

Traceback (most recent call last):
  File "/usr/bin/ubuntu-vm-builder", line 24, in <module>
    uvb.main()
  File "/usr/lib/python2.7/dist-packages/VMBuilder/contrib/cli.py", line 228, in main
    hypervisor.install_os()
  File "/usr/lib/python2.7/dist-packages/VMBuilder/hypervisor.py", line 65, in install_os
    self.call_hooks('mount_partitions', self.chroot_dir)
  File "/usr/lib/python2.7/dist-packages/VMBuilder/distro.py", line 67, in call_hooks
    call_hooks(self, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/VMBuilder/util.py", line 170, in call_hooks
    getattr(context, func)(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/VMBuilder/hypervisor.py", line 91, in mount_partitions
    disk.mkfs()
  File "/usr/lib/python2.7/dist-packages/VMBuilder/disk.py", line 151, in mkfs
    part.mkfs()
  File "/usr/lib/python2.7/dist-packages/VMBuilder/disk.py", line 306, in mkfs
    self.fs.mkfs()
  File "/usr/lib/python2.7/dist-packages/VMBuilder/disk.py", line 374, in mkfs
    run_cmd(*cmd)
  File "/usr/lib/python2.7/dist-packages/VMBuilder/util.py", line 120, in run_cmd
    raise VMBuilderException, "Process (%s) returned %d. stdout: %s, stderr: %s" % (args.__repr__(), status, mystdout.buf, mystderr.buf)
VMBuilder.exception.VMBuilderException: Process (['mkfs.ext4', '-F', '/dev/mapper/loop0p1']) returned 1. stdout: , stderr: mke2fs 1.42.12 (29-Aug-2014)
The file /dev/mapper/loop0p1 does not exist and no size was specified.

Eu sei que minha CPU suporta virtualização:

$ sudo kvm-ok
INFO: /dev/kvm exists
KVM acceleration can be used
    
por Weboide 06.02.2016 / 00:33

1 resposta

0

Isso está relacionado a esse bug , com uma correção confirmada e uma solução alternativa na descrição do erro . Para a solução alternativa, edite o arquivo disk.py.

sudo nano /usr/lib/python2.7/dist-packages/VMBuilder/disk.py

Procure o método map_partitions e adicione 'time.sleep (3)' ao final dele. A parte relevante deve acabar assim:

        for (part, mapdev) in zip(self.partitions, mapdevs):
            part.set_filename('/dev/mapper/%s' % mapdev)
        time.sleep(3)

    def mkfs(self):

Tenha em mente que o espaço em branco tem significado no Python, portanto, certifique-se de que o recuo esteja correto.

    
por user133459 04.03.2016 / 14:25