Bug 1342818

Summary: Unmanaged VMs are added without the host they run on
Product: [oVirt] ovirt-engine Reporter: Arik <ahadas>
Component: BLL.VirtAssignee: Arik <ahadas>
Status: CLOSED CURRENTRELEASE QA Contact: Artyom <alukiano>
Severity: high Docs Contact:
Priority: medium    
Version: 4.0.0CC: bugs, michal.skrivanek
Target Milestone: ovirt-4.0.0-rcKeywords: Regression, Triaged
Target Release: 4.0.0Flags: rule-engine: ovirt-4.0.0+
rule-engine: blocker+
rule-engine: planning_ack+
michal.skrivanek: devel_ack+
mavital: testing_ack+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: latest Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-07-05 07:50:30 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 Arik 2016-06-05 14:30:34 UTC
Description of problem:
As a result of recent refactoring in VMs-monitoring unmanaged VMs, either external or managed hosted-engine, are added without the host they run on. This is significant because we end up with running VMs without their hosts, so there is no operation the user can do with them.

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


How reproducible:
100%

Steps to Reproduce:
1. Add host that there are already VMs running on
2.
3.

Actual results:
The VMs are added as external VMs but without the host they run on (run_on_vds=null)

Expected results:
The VMs should be added with the host they are running on set in their dynamic data.

Additional info:

Comment 1 Red Hat Bugzilla Rules Engine 2016-06-05 14:38:21 UTC
Bug tickets must have version flags set prior to targeting them to a release. Please ask maintainer to set the correct version flags and only then set the target milestone.

Comment 2 Red Hat Bugzilla Rules Engine 2016-06-05 14:38:21 UTC
Target release should be placed once a package build is known to fix a issue. Since this bug is not modified, the target version has been reset. Please use target milestone to plan a fix for a oVirt release.

Comment 3 Red Hat Bugzilla Rules Engine 2016-06-06 05:22:58 UTC
This bug report has Keywords: Regression or TestBlocker.
Since no regressions or test blockers are allowed between releases, it is also being identified as a blocker for this release. Please resolve ASAP.

Comment 4 Red Hat Bugzilla Rules Engine 2016-06-09 06:48:51 UTC
This bug report has Keywords: Regression or TestBlocker.
Since no regressions or test blockers are allowed between releases, it is also being identified as a blocker for this release. Please resolve ASAP.

Comment 5 Michal Skrivanek 2016-06-09 06:51:11 UTC
right right, bot strikes back. alright, forget the regression keyword despite this being a regression. We just do not care about this situation so much as normally there are no external VMs

Comment 6 Arik 2016-06-09 15:06:30 UTC
external vms - sure
but what about the case of hosted engine?

Comment 7 Michal Skrivanek 2016-06-09 15:49:38 UTC
I thought HE is not affected here. Now I don't understand what I was thinking that, alrighty, back with the urgency

Comment 8 Michal Skrivanek 2016-06-09 15:51:16 UTC
even though i'm not sure it's so bad, HE is made managed properly right after, so I suppose it gets fixed. either way, backport should be trivial

Comment 9 Artyom 2016-06-21 13:01:31 UTC
Verified on rhevm-4.0.0.4-0.1.el7ev.noarch

1) Create some vm.conf on host
vmId=21a6a951-209c-42c5-b97f-e28ac80e99f6
memSize=4096
display=vnc
devices={index:2,iface:ide,address:{ controller:0, target:0,unit:0, bus:1, type:drive},specParams:{},readonly:true,deviceId:cd509fbb-5f66-4995-aae1-70a4e588f5be,path:,device:cdrom,shared:false,type:disk}
devices={device:scsi,model:virtio-scsi,type:controller}
devices={device:console,specParams:{},type:console,deviceId:4968b8e7-c1d1-4e05-a868-f080fbf3296b,alias:console0}
devices={device:vga,alias:video0,type:video}
vmName=test_vm
spiceSecureChannels=smain,sdisplay,sinputs,scursor,splayback,srecord,ssmartcard,susbredir
smp=2
cpuType=Opteron_G1
emulatedMachine=rhel6.5.0
2) Start VM via vdsClient
vdsClient -s 0 create vm.conf
3) Add host to the engine

I can see VM under the engine and I can see that VM has correct host
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<vm href="/ovirt-engine/api/vms/21a6a951-209c-42c5-b97f-e28ac80e99f6" id="21a6a951-209c-42c5-b97f-e28ac80e99f6">
    <actions>
        <link href="/ovirt-engine/api/vms/21a6a951-209c-42c5-b97f-e28ac80e99f6/ticket" rel="ticket"/>
        <link href="/ovirt-engine/api/vms/21a6a951-209c-42c5-b97f-e28ac80e99f6/reboot" rel="reboot"/>
        <link href="/ovirt-engine/api/vms/21a6a951-209c-42c5-b97f-e28ac80e99f6/undosnapshot" rel="undosnapshot"/>
        <link href="/ovirt-engine/api/vms/21a6a951-209c-42c5-b97f-e28ac80e99f6/thawfilesystems" rel="thawfilesystems"/>
        <link href="/ovirt-engine/api/vms/21a6a951-209c-42c5-b97f-e28ac80e99f6/cancelmigration" rel="cancelmigration"/>
        <link href="/ovirt-engine/api/vms/21a6a951-209c-42c5-b97f-e28ac80e99f6/commitsnapshot" rel="commitsnapshot"/>
        <link href="/ovirt-engine/api/vms/21a6a951-209c-42c5-b97f-e28ac80e99f6/clone" rel="clone"/>
        <link href="/ovirt-engine/api/vms/21a6a951-209c-42c5-b97f-e28ac80e99f6/freezefilesystems" rel="freezefilesystems"/>
        <link href="/ovirt-engine/api/vms/21a6a951-209c-42c5-b97f-e28ac80e99f6/logon" rel="logon"/>
        <link href="/ovirt-engine/api/vms/21a6a951-209c-42c5-b97f-e28ac80e99f6/maintenance" rel="maintenance"/>
        <link href="/ovirt-engine/api/vms/21a6a951-209c-42c5-b97f-e28ac80e99f6/reordermacaddresses" rel="reordermacaddresses"/>
        <link href="/ovirt-engine/api/vms/21a6a951-209c-42c5-b97f-e28ac80e99f6/detach" rel="detach"/>
        <link href="/ovirt-engine/api/vms/21a6a951-209c-42c5-b97f-e28ac80e99f6/previewsnapshot" rel="previewsnapshot"/>
        <link href="/ovirt-engine/api/vms/21a6a951-209c-42c5-b97f-e28ac80e99f6/migrate" rel="migrate"/>
        <link href="/ovirt-engine/api/vms/21a6a951-209c-42c5-b97f-e28ac80e99f6/export" rel="export"/>
        <link href="/ovirt-engine/api/vms/21a6a951-209c-42c5-b97f-e28ac80e99f6/shutdown" rel="shutdown"/>
        <link href="/ovirt-engine/api/vms/21a6a951-209c-42c5-b97f-e28ac80e99f6/start" rel="start"/>
        <link href="/ovirt-engine/api/vms/21a6a951-209c-42c5-b97f-e28ac80e99f6/stop" rel="stop"/>
        <link href="/ovirt-engine/api/vms/21a6a951-209c-42c5-b97f-e28ac80e99f6/suspend" rel="suspend"/>
    </actions>
    <name>external-test_vm</name>
    <link href="/ovirt-engine/api/vms/21a6a951-209c-42c5-b97f-e28ac80e99f6/applications" rel="applications"/>
    <link href="/ovirt-engine/api/vms/21a6a951-209c-42c5-b97f-e28ac80e99f6/disks" rel="disks"/>
    <link href="/ovirt-engine/api/vms/21a6a951-209c-42c5-b97f-e28ac80e99f6/nics" rel="nics"/>
    <link href="/ovirt-engine/api/vms/21a6a951-209c-42c5-b97f-e28ac80e99f6/numanodes" rel="numanodes"/>
    <link href="/ovirt-engine/api/vms/21a6a951-209c-42c5-b97f-e28ac80e99f6/cdroms" rel="cdroms"/>
    <link href="/ovirt-engine/api/vms/21a6a951-209c-42c5-b97f-e28ac80e99f6/snapshots" rel="snapshots"/>
    <link href="/ovirt-engine/api/vms/21a6a951-209c-42c5-b97f-e28ac80e99f6/tags" rel="tags"/>
    <link href="/ovirt-engine/api/vms/21a6a951-209c-42c5-b97f-e28ac80e99f6/permissions" rel="permissions"/>
    <link href="/ovirt-engine/api/vms/21a6a951-209c-42c5-b97f-e28ac80e99f6/statistics" rel="statistics"/>
    <link href="/ovirt-engine/api/vms/21a6a951-209c-42c5-b97f-e28ac80e99f6/reporteddevices" rel="reporteddevices"/>
    <link href="/ovirt-engine/api/vms/21a6a951-209c-42c5-b97f-e28ac80e99f6/watchdogs" rel="watchdogs"/>
    <link href="/ovirt-engine/api/vms/21a6a951-209c-42c5-b97f-e28ac80e99f6/sessions" rel="sessions"/>
    <link href="/ovirt-engine/api/vms/21a6a951-209c-42c5-b97f-e28ac80e99f6/katelloerrata" rel="katelloerrata"/>
    <link href="/ovirt-engine/api/vms/21a6a951-209c-42c5-b97f-e28ac80e99f6/graphicsconsoles" rel="graphicsconsoles"/>
    <link href="/ovirt-engine/api/vms/21a6a951-209c-42c5-b97f-e28ac80e99f6/hostdevices" rel="hostdevices"/>
    <link href="/ovirt-engine/api/vms/21a6a951-209c-42c5-b97f-e28ac80e99f6/diskattachments" rel="diskattachments"/>
    <bios>
        <boot_menu>
            <enabled>false</enabled>
        </boot_menu>
    </bios>
    <console>
        <enabled>false</enabled>
    </console>
    <cpu>
        <architecture>x86_64</architecture>
        <topology>
            <cores>1</cores>
            <sockets>2</sockets>
            <threads>1</threads>
        </topology>
    </cpu>
    <cpu_shares>0</cpu_shares>
    <creation_time>2016-06-21T08:56:57.731-04:00</creation_time>
    <delete_protected>false</delete_protected>
    <display>
        <address>cyan-vdsg.qa.lab.tlv.redhat.com</address>
        <allow_override>false</allow_override>
        <copy_paste_enabled>true</copy_paste_enabled>
        <disconnect_action>LOCK_SCREEN</disconnect_action>
        <file_transfer_enabled>true</file_transfer_enabled>
        <monitors>1</monitors>
        <port>5900</port>
        <single_qxl_pci>false</single_qxl_pci>
        <smartcard_enabled>false</smartcard_enabled>
        <type>vnc</type>
    </display>
    <high_availability>
        <enabled>false</enabled>
        <priority>0</priority>
    </high_availability>
    <initialization>
        <configuration>
            <data>&lt;?xml version="1.0" encoding="UTF-8"?&gt;&lt;ovf:Envelope xmlns:ovf="http://schemas.dmtf.org/ovf/envelope/1/" xmlns:rasd="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData" xmlns:vssd="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ovf:version="4.0.0.0"&gt;&lt;References&gt;&lt;/References&gt;&lt;Section xsi:type="ovf:NetworkSection_Type"&gt;&lt;Info&gt;List of networks&lt;/Info&gt;&lt;Network ovf:name="Network 1"&gt;&lt;/Network&gt;&lt;/Section&gt;&lt;Section xsi:type="ovf:DiskSection_Type"&gt;&lt;Info&gt;List of Virtual Disks&lt;/Info&gt;&lt;/Section&gt;&lt;Content ovf:id="out" xsi:type="ovf:VirtualSystem_Type"&gt;&lt;CreationDate&gt;2016/06/21 12:56:57&lt;/CreationDate&gt;&lt;ExportDate&gt;2016/06/21 13:00:09&lt;/ExportDate&gt;&lt;DeleteProtected&gt;false&lt;/DeleteProtected&gt;&lt;SsoMethod&gt;guest_agent&lt;/SsoMethod&gt;&lt;IsSmartcardEnabled&gt;false&lt;/IsSmartcardEnabled&gt;&lt;TimeZone&gt;Etc/GMT&lt;/TimeZone&gt;&lt;default_boot_sequence&gt;0&lt;/default_boot_sequence&gt;&lt;Generation&gt;1&lt;/Generation&gt;&lt;ClusterCompatibilityVersion&gt;4.0&lt;/ClusterCompatibilityVersion&gt;&lt;VmType&gt;0&lt;/VmType&gt;&lt;MinAllocatedMem&gt;4096&lt;/MinAllocatedMem&gt;&lt;IsStateless&gt;false&lt;/IsStateless&gt;&lt;IsRunAndPause&gt;false&lt;/IsRunAndPause&gt;&lt;AutoStartup&gt;false&lt;/AutoStartup&gt;&lt;Priority&gt;0&lt;/Priority&gt;&lt;CreatedByUserId&gt;00000000-0000-0000-0000-000000000000&lt;/CreatedByUserId&gt;&lt;MigrationSupport&gt;0&lt;/MigrationSupport&gt;&lt;IsBootMenuEnabled&gt;false&lt;/IsBootMenuEnabled&gt;&lt;IsSpiceFileTransferEnabled&gt;true&lt;/IsSpiceFileTransferEnabled&gt;&lt;IsSpiceCopyPasteEnabled&gt;true&lt;/IsSpiceCopyPasteEnabled&gt;&lt;CustomEmulatedMachine&gt;&lt;/CustomEmulatedMachine&gt;&lt;CustomCpuName&gt;&lt;/CustomCpuName&gt;&lt;PredefinedProperties&gt;&lt;/PredefinedProperties&gt;&lt;UserDefinedProperties&gt;&lt;/UserDefinedProperties&gt;&lt;Name&gt;external-test_vm&lt;/Name&gt;&lt;TemplateId&gt;00000000-0000-0000-0000-000000000000&lt;/TemplateId&gt;&lt;TemplateName&gt;Blank&lt;/TemplateName&gt;&lt;IsInitilized&gt;false&lt;/IsInitilized&gt;&lt;Origin&gt;4&lt;/Origin&gt;&lt;DefaultDisplayType&gt;1&lt;/DefaultDisplayType&gt;&lt;TrustedService&gt;false&lt;/TrustedService&gt;&lt;OriginalTemplateId&gt;00000000-0000-0000-0000-000000000000&lt;/OriginalTemplateId&gt;&lt;OriginalTemplateName&gt;Blank&lt;/OriginalTemplateName&gt;&lt;UseHostCpu&gt;false&lt;/UseHostCpu&gt;&lt;UseLatestVersion&gt;false&lt;/UseLatestVersion&gt;&lt;Section ovf:id="21a6a951-209c-42c5-b97f-e28ac80e99f6" ovf:required="false" xsi:type="ovf:OperatingSystemSection_Type"&gt;&lt;Info&gt;Guest Operating System&lt;/Info&gt;&lt;Description&gt;other&lt;/Description&gt;&lt;/Section&gt;&lt;Section xsi:type="ovf:VirtualHardwareSection_Type"&gt;&lt;Info&gt;2 CPU, 4096 Memory&lt;/Info&gt;&lt;System&gt;&lt;vssd:VirtualSystemType&gt;ENGINE 4.0.0.0&lt;/vssd:VirtualSystemType&gt;&lt;/System&gt;&lt;Item&gt;&lt;rasd:Caption&gt;2 virtual cpu&lt;/rasd:Caption&gt;&lt;rasd:Description&gt;Number of virtual CPU&lt;/rasd:Description&gt;&lt;rasd:InstanceId&gt;1&lt;/rasd:InstanceId&gt;&lt;rasd:ResourceType&gt;3&lt;/rasd:ResourceType&gt;&lt;rasd:num_of_sockets&gt;2&lt;/rasd:num_of_sockets&gt;&lt;rasd:cpu_per_socket&gt;1&lt;/rasd:cpu_per_socket&gt;&lt;rasd:threads_per_cpu&gt;1&lt;/rasd:threads_per_cpu&gt;&lt;/Item&gt;&lt;Item&gt;&lt;rasd:Caption&gt;4096 MB of memory&lt;/rasd:Caption&gt;&lt;rasd:Description&gt;Memory Size&lt;/rasd:Description&gt;&lt;rasd:InstanceId&gt;2&lt;/rasd:InstanceId&gt;&lt;rasd:ResourceType&gt;4&lt;/rasd:ResourceType&gt;&lt;rasd:AllocationUnits&gt;MegaBytes&lt;/rasd:AllocationUnits&gt;&lt;rasd:VirtualQuantity&gt;4096&lt;/rasd:VirtualQuantity&gt;&lt;/Item&gt;&lt;Item&gt;&lt;rasd:Caption&gt;USB Controller&lt;/rasd:Caption&gt;&lt;rasd:InstanceId&gt;3&lt;/rasd:InstanceId&gt;&lt;rasd:ResourceType&gt;23&lt;/rasd:ResourceType&gt;&lt;rasd:UsbPolicy&gt;DISABLED&lt;/rasd:UsbPolicy&gt;&lt;/Item&gt;&lt;/Section&gt;&lt;/Content&gt;&lt;/ovf:Envelope&gt;</data>
            <type>ovf</type>
        </configuration>
    </initialization>
    <io>
        <threads>0</threads>
    </io>
    <large_icon href="/ovirt-engine/api/icons/10b44f70-b36e-43a3-9756-b328459d3827" id="10b44f70-b36e-43a3-9756-b328459d3827"/>
    <memory>4294967296</memory>
    <memory_policy>
        <ballooning>true</ballooning>
        <guaranteed>4294967296</guaranteed>
    </memory_policy>
    <migration>
        <auto_converge>inherit</auto_converge>
        <compressed>inherit</compressed>
    </migration>
    <migration_downtime>-1</migration_downtime>
    <origin>external</origin>
    <os>
        <boot>
            <devices>
                <device>hd</device>
            </devices>
        </boot>
        <type>other</type>
    </os>
    <small_icon href="/ovirt-engine/api/icons/d3f90288-bd25-47de-b1ba-2f5c4796ad6b" id="d3f90288-bd25-47de-b1ba-2f5c4796ad6b"/>
    <soundcard_enabled>true</soundcard_enabled>
    <sso>
        <methods>
            <method id="guest_agent"/>
        </methods>
    </sso>
    <start_paused>false</start_paused>
    <stateless>false</stateless>
    <time_zone>
        <name>Etc/GMT</name>
    </time_zone>
    <type>desktop</type>
    <usb>
        <enabled>false</enabled>
    </usb>
    <virtio_scsi>
        <enabled>true</enabled>
    </virtio_scsi>
    <cluster href="/ovirt-engine/api/clusters/70146e4c-9500-4793-994f-3aefdb160e12" id="70146e4c-9500-4793-994f-3aefdb160e12"/>
    <cpu_profile href="/ovirt-engine/api/cpuprofiles/55991f76-00d5-43b1-9fae-6abaaa3254a5" id="55991f76-00d5-43b1-9fae-6abaaa3254a5"/>
    <next_run_configuration_exists>false</next_run_configuration_exists>
    <numa_tune_mode>interleave</numa_tune_mode>
    <placement_policy>
        <affinity>migratable</affinity>
    </placement_policy>
    <run_once>false</run_once>
    <status>up</status>
    <host href="/ovirt-engine/api/hosts/a96de113-0119-4c98-8c77-755fa855dcae" id="a96de113-0119-4c98-8c77-755fa855dcae"/>
    <template href="/ovirt-engine/api/templates/00000000-0000-0000-0000-000000000000" id="00000000-0000-0000-0000-000000000000"/>
</vm>

Comment 10 Sandro Bonazzola 2016-07-05 07:50:30 UTC
oVirt 4.0.0 has been released, closing current release.