ERROR Guest name ‘img-build-centos7-amd64’ is already in use.

For whatever reason, the maas-image-builder script for CentOS 7 does not like our local mirror.  We’ll investigate further.  But the problem is that it leaves the qemu vm in a bit of a half baked state.  The process fails, but it doesn’t clean up after itself.  No matter, as we can just as easily do that ourselves.

[email protected]:~/maas-image-builder# ./bin/build centos amd64 –centos-edition 7
Formatting ‘/tmp/img-builder-3Eef5T/disk.img’, fmt=raw size=5368709120
WARNING  KVM acceleration not available, using ‘qemu’
ERROR    Guest name ‘img-build-centos7-amd64’ is already in use.
Traceback (most recent call last):
  File “./bin/build”, line 45, in
  File “/root/maas-image-builder/builder/”, line 108, in main
  File “/root/maas-image-builder/builder/osystems/”, line 101, in build_image
    super(CentOS, self).build_image(params)
  File “/root/maas-image-builder/builder/osystems/”, line 158, in build_image
  File “/root/maas-image-builder/builder/”, line 76, in install_location
  File “/usr/lib/python2.7/”, line 540, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command ‘[u’virt-install’, u’–name’, u’img-build-centos7-amd64′, u’–ram’, u’2048′, u’–arch’, u’x86_64′, u’–vcpus’, u’1′, u’–os-type’, u’linux’, u’–os-variant’, u’rhel5′, u’–disk’, u’path=/tmp/img-builder-3Eef5T/disk.img,format=raw’, u’–network’, u’bridge=virbr0,model=virtio’, u’–location’, u’′, u’–initrd-inject=/root/maas-image-builder/contrib/centos/centos7/centos7-amd64.ks’, u’–extra-args=console=ttyS0 inst.ks=file:/centos7-amd64.ks text inst.cmdline inst.headless’, u’–noreboot’, u’–nographics’, u’–force’]’ returned non-zero exit status 1
[email protected]:~/maas-image-builder# virsh list –all
 Id    Name                           State
 4     img-build-centos7-amd64        running

[email protected]:~/maas-image-builder# virsh undefine  img-build-centos7-amd64
Domain img-build-centos7-amd64 has been undefined

[email protected]:~/maas-image-builder# virsh list –all
 Id    Name                           State
 4     img-build-centos7-amd64        running

[email protected]:~/maas-image-builder# virsh destroy  img-build-centos7-amd64
Domain img-build-centos7-amd64 destroyed

[email protected]:~/maas-image-builder# virsh list –all
 Id    Name                           State

[email protected]:~/maas-image-builder#
Now we can set about the task of building the image once more.

Leave a Reply

Your email address will not be published. Required fields are marked *