User Tools

Site Tools


unix:scripts:libvirt

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
unix:scripts:libvirt [2024/09/20 20:48] rodolicounix:scripts:libvirt [2024/09/20 21:23] (current) rodolico
Line 4: Line 4:
  
 This little one liner grabs the lines that define the vnc ports used by all defined on a node (hypervisor) and returns them as a tab delimited string. This little one liner grabs the lines that define the vnc ports used by all defined on a node (hypervisor) and returns them as a tab delimited string.
 +
 +==== Code ====
  
 <code bash> <code bash>
Line 22: Line 24:
 libvirt (virsh) stores it's domain (virtual) definitions in /etc/libvirt/qemu/*.xml. The //grep// command only returns those lines (along with the file name) in the form libvirt (virsh) stores it's domain (virtual) definitions in /etc/libvirt/qemu/*.xml. The //grep// command only returns those lines (along with the file name) in the form
 <code> <code>
-/media/shared/havirt/conf/andrei.dailydata.noc.xml:    <graphics type='vnc' port='5917' autoport='no' listen='127.0.0.1'>+/etc/libvirt/qemu/andrei.dailydata.noc.xml:    <graphics type='vnc' port='5917' autoport='no' listen='127.0.0.1'>
 </code> </code>
  
Line 32: Line 34:
   * If there is only one domain defined, grep does not return the filename, so the system breaks.   * If there is only one domain defined, grep does not return the filename, so the system breaks.
   * This is totally dependent on how libvirt stores the data; path, key and whether the key is on the same line. Any changes to the libvirt storage will break the script.   * This is totally dependent on how libvirt stores the data; path, key and whether the key is on the same line. Any changes to the libvirt storage will break the script.
 +  * We use [[https://unixservertech.com/havirt/|havirt]] for our clusters. havirt stores the domain definitions in <installdir>/conf, so the grep command will need to be changed.
unix/scripts/libvirt.1726883282.txt.gz · Last modified: 2024/09/20 20:48 by rodolico