Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1580478

Summary: Vdsm should support hotunplug by Alias
Product: [oVirt] vdsm Reporter: Francesco Romani <fromani>
Component: CoreAssignee: Francesco Romani <fromani>
Status: CLOSED CURRENTRELEASE QA Contact: Israel Pinto <ipinto>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 4.20.23CC: bugs
Target Milestone: ovirt-4.2.4Flags: rule-engine: ovirt-4.2+
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: vdsm-4.20.28-1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-06-26 08:43:03 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Virt RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Francesco Romani 2018-05-21 14:48:42 UTC
Description of problem:
Engine > 4.2.3 wants to send a simplified XML to identify a device to hotunplug.
Engine wants to send something like

<?xml version='1.0' encoding='UTF-8'?>
<hotplug>
  <devices>
    <interface>
      <alias name="something">
    </interface>
  </devices>
</hotplug>

Instead of the full XML currently required. A RFE is being filed against libvirt to natively support this, but until that is implemented, Vdsm should fill the gap and
1. retrieve a valid device XML out of alias
2. feed it to libvirt to hotunplug the device

Version-Release number of selected component (if applicable):
4.20.27

How reproducible:
100%

Steps to Reproduce:
1. send minimal XML as per example above in the hotunplug request for NICs, Drives, memory
2. 
3.

Actual results:
Hotunplug will fail

Expected results:
Hotunplug should succeed

Additional info:
Vdsm must keep working to <= 4.1 Engines as before

To verify:
- not regression: check hotunplug works fine with NICs, Drives, memory, with Engine 4.1 or earlier
- proper verification: with updated Engine (version to be added), check hotunplug works fine with NICs, drives, memory

Comment 1 Israel Pinto 2018-06-04 09:22:14 UTC
Verify with:
Engine: 4.2.4-2
Host: vdsm-4.20.29-1.el7ev


I checked hot unplug for Nic, Disk, Memory, CPU:

From vdsm log:
Hotunplug NIC xml: <?xml version='1.0' encoding='utf-8'?>
<interface type="bridge">
    <address bus="0x00" domain="0x0000" function="0x0" slot="0x09" type="pci" />
    <mac address="00:1a:4a:16:10:ef" />
    <model type="virtio" />
    <source bridge="ovirtmgmt" />
    <filterref filter="vdsm-no-mac-spoofing" />
    <link state="up" />
    <alias name="ua-ced08abd-8e44-4c2c-8018-3cd4fbde254e" />
</interface>


Hotunplug disk xml: <?xml version='1.0' encoding='utf-8'?>
<disk device="disk" snapshot="no" type="block">
    <address bus="0" controller="0" target="0" type="drive" unit="1" />
    <source dev="/rhev/data-center/mnt/blockSD/7624cec9-1ec5-4feb-a04b-8362bc501206/images/560c0fcd-2101-4a7d-bba0-8007365009a2/7d09e9a3-03a3-4228-bdcb-15332ca60d4b" />
    <target bus="scsi" dev="sda" />
    <serial>560c0fcd-2101-4a7d-bba0-8007365009a2</serial>
    <driver cache="none" error_policy="stop" io="native" name="qemu" type="raw" />
    <alias name="scsi0-0-0-1" />
</disk>

Hotunplug memory xml: <?xml version='1.0' encoding='utf-8'?>
    <memory model="dimm">
    <target>
        <size unit="KiB">917504</size>
        <node>0</node>
    </target>
    <alias name="dimm1" />
    <address base="0x108000000" slot="1" type="dimm" />
    </memory>

CPU hotunplg: No XML (checked with DEV no XML)
 setNumberOfCpus(numberOfCpus='1') from=::ffff:10.35.163.152,57822, flow_id=4faced4b, vmId=35269181-eae5-4a78-afb9-c2ebeab9540f (api:46)

PASS

Comment 2 Sandro Bonazzola 2018-06-26 08:43:03 UTC
This bugzilla is included in oVirt 4.2.4 release, published on June 26th 2018.

Since the problem described in this bug report should be
resolved in oVirt 4.2.4 release, it has been closed with a resolution of CURRENT RELEASE.

If the solution does not work for you, please open a new bug report.