Bug 1274677

Summary: [ppc64le] After cloning a vm from a template, vm fails to start with XML error: target 'sda' duplicated for disk sources
Product: [oVirt] ovirt-engine Reporter: Carlos Mestre González <cmestreg>
Component: BLL.VirtAssignee: Marek Libra <mlibra>
Status: CLOSED CURRENTRELEASE QA Contact: Ilanit Stein <istein>
Severity: high Docs Contact:
Priority: unspecified    
Version: 3.6.0CC: amureini, bugs, hannsj_uhl, mgoldboi, michal.skrivanek, tjelinek, ylavi
Target Milestone: ovirt-3.6.1Flags: rule-engine: ovirt-3.6.z+
mgoldboi: planning_ack+
rule-engine: devel_ack+
rule-engine: testing_ack+
Target Release: 3.6.1   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: virt
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-01-13 14:37:13 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:
Bug Depends On:    
Bug Blocks: 1201513    
Attachments:
Description Flags
rest api calls
none
engine.log
none
vdsm.log none

Description Carlos Mestre González 2015-10-23 10:48:59 UTC
Description of problem:
Clone a vm from a template and then start it fails. Not sure why is this the case since other multiple (similar) clone action works in the same run multiple times

Version-Release number of selected component (if applicable):
ovirt 3.6.0-15
vdsm-xmlrpc-4.17.9-1.el7ev.noarch
vdsm-python-4.17.9-1.el7ev.noarch
vdsm-jsonrpc-4.17.9-1.el7ev.noarch
vdsm-4.17.9-1.el7ev.noarch
vdsm-cli-4.17.9-1.el7ev.noarch
vdsm-infra-4.17.9-1.el7ev.noarch
vdsm-yajsonrpc-4.17.9-1.el7ev.noarch
libvirt-daemon-driver-nwfilter-1.2.17-13.el7.ppc64le
libvirt-daemon-driver-interface-1.2.17-13.el7.ppc64le
libvirt-daemon-driver-network-1.2.17-13.el7.ppc64le
libvirt-daemon-driver-nodedev-1.2.17-13.el7.ppc64le
libvirt-daemon-kvm-1.2.17-13.el7.ppc64le
libvirt-python-1.2.17-2.el7.ppc64le
libvirt-client-1.2.17-13.el7.ppc64le
libvirt-daemon-1.2.17-13.el7.ppc64le
libvirt-daemon-driver-secret-1.2.17-13.el7.ppc64le
libvirt-daemon-driver-storage-1.2.17-13.el7.ppc64le
libvirt-daemon-driver-qemu-1.2.17-13.el7.ppc64le
libvirt-daemon-config-nwfilter-1.2.17-13.el7.ppc64le
libvirt-lock-sanlock-1.2.17-13.el7.ppc64le
qemu-img-rhev-2.3.0-31.el7.ppc64le
qemu-kvm-tools-rhev-2.3.0-31.el7.ppc64le
qemu-kvm-rhev-2.3.0-31.el7.ppc64le
qemu-kvm-common-rhev-2.3.0-31.el7.ppc64le

How reproducible:
Not sure since I cannot pin point what's the specific issue here, clone & start seems to work

Steps to Reproduce:
1. Clone a vm from a template and start it with the Rest call attached

Actual results:
21:12:24 2015-10-19 21:12:27,558 - MainThread - plmanagement.error_fetcher - ERROR - Errors fetched from VDC(jenkins-vm-15.scl.lab.tlv.redhat.com): 2015-10-19 21:02:20,733 ERROR [org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector] (ForkJoinPool-1-worker-1) [] Correlation ID: null, Call Stack: null, Custom Event ID: -1, Message: VM storage_vm_server is down with error. Exit message: XML error: target 'sda' duplicated for disk sources '/rhev/data-center/c46b2a29-2767-4450-9d26-0d0fc3b0cba0/1c8e846d-5ae3-4b17-a2ac-b2ef63107115/images/8325d3ea-e787-4bed-ad98-efc1a3426a70/a3a5b85a-1cc9-4734-b345-0f63e9a28560' and '<null>'.
21:12:24 2015-10-19 21:02:20,733 INFO  [org.ovirt.engine.core.vdsbroker.VmAnalyzer] (ForkJoinPool-1-worker-1) [] Running on vds during rerun failed vm: 'd40172dd-0600-420b-9e4b-2456349843aa'
21:12:24 2015-10-19 21:02:20,744 ERROR [org.ovirt.engine.core.vdsbroker.VmsMonitoring] (ForkJoinPool-1-worker-1) [] Rerun VM '31842175-0cd2-4678-9cb0-16c5c3288172'. Called from VDS 'host_mixed_1'
21:12:24 2015-10-19 21:02:20,753 WARN  [org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector] (org.ovirt.thread.pool-7-thread-12) [] Correlation ID: vms_syncAction_37c8fab8-3df7-4288, Job ID: 2da808c9-19c6-468e-b704-8261a88b2635, Call Stack: null, Custom Event ID: -1, Message: Failed to run VM storage_vm_server on Host host_mixed_1.
21:12:24 2015-10-19 21:02:38,605 ERROR [org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector] (DefaultQuartzScheduler_Worker-30) [] Correlation ID: null, Call Stack: null, Custom Event ID: -1, Message: VM storage_vm_server is down with error. Exit message: XML error: target 'sda' duplicated for disk sources '/rhev/data-center/c46b2a29-2767-4450-9d26-0d0fc3b0cba0/1c8e846d-5ae3-4b17-a2ac-b2ef63107115/images/8325d3ea-e787-4bed-ad98-efc1a3426a70/a3a5b85a-1cc9-4734-b345-0f63e9a28560' and '<null>'.
21:12:24 2015-10-19 21:02:38,605 INFO  [org.ovirt.engine.core.vdsbroker.VmAnalyzer] (DefaultQuartzScheduler_Worker-30) [] Running on vds during rerun failed vm: 'null'

I'm adding this to Virt for the moment.

Comment 1 Carlos Mestre González 2015-10-23 11:02:19 UTC
Created attachment 1085815 [details]
rest api calls

Comment 2 Carlos Mestre González 2015-10-23 11:03:38 UTC
Created attachment 1085816 [details]
engine.log

20:59:32 starts the vm creation.

Comment 3 Carlos Mestre González 2015-10-23 11:06:47 UTC
Created attachment 1085817 [details]
vdsm.log

Sorry, the host time doesn't match the one from the engine. check 2015-10-19 14:02:39,748

Comment 4 Allon Mureinik 2015-10-28 18:10:13 UTC
Michal - can your team take lead on this please? If you decide it's more of a storage issue than a virt one, we'll take it off your hands, of course.

Comment 5 Tomas Jelinek 2015-10-29 12:58:41 UTC
yep, seems like virt.

Comment 6 Red Hat Bugzilla Rules Engine 2015-10-29 22:47:28 UTC
This bug is not marked for z-stream, yet the milestone is for a z-stream version, therefore the milestone has been reset.
Please set the correct milestone or add the z-stream flag.

Comment 7 Marek Libra 2015-11-10 07:41:30 UTC
The CDROM is assigned to sda. Subsequent disk assignment is incorrectly handled (starting from sda as well).
The bug can be fixed by setting correct "index" attribute for disk sent from engine in case of VirtIO-SCSI.

Comment 8 Marek Libra 2015-11-11 09:11:23 UTC
Update of comment 7: the disk index is incorrectly set for first bootable disk.

Comment 9 Allon Mureinik 2015-11-16 08:54:01 UTC
*** Bug 1281847 has been marked as a duplicate of this bug. ***

Comment 10 Amit Aviram 2015-11-16 14:51:45 UTC
*** Bug 1281848 has been marked as a duplicate of this bug. ***

Comment 11 Ilanit Stein 2015-12-29 07:56:34 UTC
Verified on rhevm 3.6.1-4.

Create the VM:
=============

https://<engine IP address>:443/ovirt-engine/api/vms  
POST
Headers: Content-Type: application/xml

<vm>
    <name>storage_vm_server</name>
    <type>server</type>
    <os type="rhel_7_ppc64"/>
    <cluster href="/api/clusters/2d5db03a-7a36-490b-84b6-a0722411e588" id="2d5db03a-7a36-490b-84b6-a0722411e588">
        <name>golden_env_mixed_1</name>
    </cluster>
    <display>
        <type>vnc</type>
    </display>
    <virtio_scsi enabled="true"/>
    <template href="/api/templates/e22d3cbf-43d1-4341-a3dc-e5ac0cebd26d" id="e22d3cbf-43d1-4341-a3dc-e5ac0cebd26d">
        <name>golden_mixed_virtio_template</name>
    </template>
    <disks>
        <disk id="c44da4a5-0679-4f9b-9ae9-baeef0beba29">  <== Template's disk id
            <storage_domains>
                <storage_domain>
                    <name>iscsi_0</name>                  
                </storage_domain>
            </storage_domains>
            <format>cow</format>
            <sparse>true</sparse>
        </disk>
        <clone>true</clone>
    </disks>
    <memory_policy/>
</vm>


Start the VM:
============
https://<engine IP address>:443/ovirt-engine/api/vms/878a7f92-94d8-4dad-8835-245c6c30c22f/start
POST
Headers: Content-Type: application/xml

<action>
    <async>false</async>
    <grace_period>
        <expiry>10</expiry>
    </grace_period>
</action>

Comment 12 Sandro Bonazzola 2016-01-13 14:37:13 UTC
oVirt 3.6.1 has been released, closing current release