bitraf / infrastructure

Infrastructure stuff for Bitraf's sysadmins
1 stars 3 forks source link

riemann: vm riemann does not start. cause: reference to removed iso image #181

Open tingox opened 1 week ago

tingox commented 1 week ago

When you try to start riemann, you get an error:

tingo@bite:~$ sudo virsh start riemann
error: Failed to start domain riemann
error: Cannot access storage file '/var/lib/iso/debian-9.1.0-amd64-netinst.iso': No such file or directory

dumping the xml via sudo virsh dumpxml riemann I see

    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <source file='/var/lib/iso/debian-9.1.0-amd64-netinst.iso'/>
      <target dev='hda' bus='ide'/>
      <readonly/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>

which is the most likely cause.

tingox commented 1 week ago

and of course you can't change that via attach-disk for a non running domain

tingo@bite:~$ sudo virsh attach-disk riemann " " hda --type cdrom --mode readonly
error: Failed to attach disk
error: Requested operation is not valid: domain is not running
tingox commented 1 week ago

but I can do this

tingo@bite:~$ sudo virsh attach-disk riemann " " hda --type cdrom --mode readonly --print-xml
<disk type='block' device='cdrom'>
  <source dev=' '/>
  <target dev='hda'/>
  <readonly/>
</disk>
tingox commented 1 week ago

and if I try to edit it fails to validate

sudo EDITOR=vi virsh edit riemann
error: XML document failed to validate against schema: Unable to validate doc against /usr/share/libvirt/schemas/domain.rng
Extra element devices in interleave
Element domain failed to validate content

Failed. Try again? [y,n,i,f,?]: 
tingox commented 1 week ago

but deleting that section worked

tingo@bite:~$ sudo EDITOR=vi virsh edit riemann
Domain riemann XML configuration edited.
tingox commented 1 week ago

and then riemann can be started

tingo@bite:~$ !1443
sudo virsh start riemann
Domain riemann started

leaving this issue open for root cause analysis and fix.