Disk can only be added once on UI

Ref: https://github.com/harvester/harvester/issues/1608

Verify Items

  • NVMe disk can only be added once on UI

Case: add new NVMe disk on dashboard UI

  1. Install Harvester with 2 nodes
  2. Power off 2nd node
  3. Update VM’s xml definition (by using virsh edit or virt-manager)
    • Create nvme.img block: dd if=/dev/zero of=/var/lib/libvirt/images/nvme.img bs=1M count=4096
    • change owner chown qemu:qemu /var/lib/libvirt/images/nvme.img
    • update <domain type="kvm"> to <domain type="kvm" xmlns:qemu="http://libvirt.org/schemas/domain/qemu/1.0">
    • append xml node into domain as below:
  <qemu:commandline>
    <qemu:arg value="-drive"/>
    <qemu:arg value="file=/var/lib/libvirt/images/nvme.img,if=none,id=D22,format=raw"/>
    <qemu:arg value="-device"/>
    <qemu:arg value="nvme,drive=D22,serial=1234"/>
  </qemu:commandline>
  1. Power on 2nd node
  2. login to dashboard, then click Edit Config on 2nd node
  3. Navigate to Disks tab, then add the NVMe disk from the drop-down list of Add Disk
  4. The NVMe disk should disappear from the drop-down list
  5. Cick Save, Edit Config on 2nd node again
  6. The NVMe disk should not able to be added again image image