Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1029061

Summary: ocf:heartbeat:VirtualDomain does not parse domain name from xml
Product: Red Hat Enterprise Linux 7 Reporter: michal novacek <mnovacek>
Component: resource-agentsAssignee: David Vossel <dvossel>
Status: CLOSED CURRENTRELEASE QA Contact: Cluster QE <mspqa-list>
Severity: high Docs Contact:
Priority: unspecified    
Version: 7.0CC: agk, cluster-maint, fdinitto
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: resource-agents-3.9.5-22.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-06-13 13:02:46 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description michal novacek 2013-11-11 15:14:18 UTC
Description of problem:
ocf:heartbeat:VirtualDomain agent will not for some reason correctly parse
domain name from xml file which will consequently disallow it from starting.
The domain can be started manually.

Version-Release number of selected component (if applicable):
resource-agents-3.9.5-16.el7.x86_64

How reproducible: always

Steps to Reproduce:
1. create lxc containers with lxc_autogen.sh from pacemaker-cts package.
2. create resource for that container 
3. see it end up in FAILED state

Actual results: resource not starting ending in FAILED state

Expected results: resource started

Additional info:

# pcs resource show R-light-02-node01-lxc
 Resource: R-light-02-node01-lxc (class=ocf provider=heartbeat type=VirtualDomain)
  Attributes: hypervisor=lxc:/// config=/var/lib/libvirt/lxc/light-02-node01.xml force_stop=true 
  Operations: monitor interval=60s (R-light-02-node01-lxc-monitor-interval-60s)

# cat /var/lib/libvirt/lxc/light-02-node01.xml
        <domain type='lxc'>
          <name>light-02-node01</name> 
          <memory>102400</memory>
          <os>
            <type>exe</type>
            <init>/var/lib/libvirt/lxc/light-02-node01/filesystem/launch-helper</init> 
          </os>
          <vcpu>1</vcpu>
          <clock offset='utc' />
          <on_poweroff>destroy</on_poweroff>
          <on_reboot>restart</on_reboot>
          <on_crash>destroy</on_crash>
          <devices>
            <console type='pty'/>
            <emulator>/usr/libexec/libvirt_lxc</emulator>
            <interface type='network'>
              <mac address='52:54:00:11:47:4'/>
              <source network='default'/>
            </interface>
            <filesystem type='mount'>
              <source dir='/var/lib/libvirt/lxc/light-02-node01/filesystem/var/run'/>
              <target dir='/var/run'/>
            </filesystem>
            <filesystem type='mount'>
              <source dir='/var/lib/libvirt/lxc/light-02-node01/filesystem/usr/var/run'/>
              <target dir='/usr/var/run'/>
            </filesystem>
          </devices>
        </domain>

# pcs resource debug-start R-light-02-node01-lxc
Operation start for R-light-02-node01-lxc (ocf:heartbeat:VirtualDomain) returned 1
 >  stderr: ERROR: This is unexpected. Cannot determine domain name.

# virsh -c lxc:/// define /var/lib/libvirt/lxc/light-02-node01.xml
Domain light-02-node01 defined from /var/lib/libvirt/lxc/light-02-node01.xml

# virsh -c lxc:/// start light-02-node01
Domain light-02-node01 started

# virsh list
 Id    Name                           State
----------------------------------------------------
 3     light-02-node01                running


This problem exist in the VirtualDomain resource agent downloaded from upstream
with: /usr/share/pacemaker/tests/cts/lxc_autogen.sh -d

Comment 3 David Vossel 2014-01-20 16:32:27 UTC
There is an upstream patch related to this issue.

https://github.com/davidvossel/resource-agents/commit/bd3b09252eedbeeab2635f82259714975702257e

Comment 5 michal novacek 2014-03-31 14:45:29 UTC
I have verified that it is possible to create VirtualDomain resource with xml
similar to the one in initial bug report with
resource-agents-3.9.5-26.el7.x86_64.

---

duck-03# cat /var/lib/libvirt/lxc/duck-03-node01.xml 
        <domain type='lxc'>
          <name>duck-03-node01</name> 
          <memory unit='KiB'>102400</memory>
          <vcpu placement='static'>1</vcpu>
          <os>
            <type arch='x86_64'>exe</type>
            <init>/var/lib/libvirt/lxc/duck-03-node01/filesystem/launch-helper</init>
          </os>
          <clock offset='utc' />
          <on_poweroff>destroy</on_poweroff>
          <on_reboot>restart</on_reboot>
          <on_crash>destroy</on_crash>
          <devices>
            <emulator>/usr/libexec/libvirt_lxc</emulator>
            <filesystem type='mount' accessmode='passthrough'>
              <source dir='/var/lib/libvirt/lxc/duck-03-node01/filesystem/var/run'/>
              <target dir='/var/run'/>
            </filesystem>
            <filesystem type='mount'>
              <source dir='/var/lib/libvirt/lxc/duck-03-node01/filesystem/usr/var/run'/>
              <target dir='/usr/var/run'/>
            </filesystem>
            <interface type='network'>
              <mac address='52:54:00:11:05:51'/>
              <source network='default'/>
            </interface>
            <console type='pty'>
              <target type='lxc' port='0'/>
            </console>
          </devices>
        </domain>

duck-03# virt-xml-validate /var/lib/libvirt/lxc/duck-03-node01.xml 
/var/lib/libvirt/lxc/duck-03-node01.xml validates

duck-03# pcs status
Cluster name: STSRHTS30970
Last updated: Mon Mar 31 16:41:52 2014
Last change: Mon Mar 31 16:38:42 2014 via crm_resource on duck-03
Stack: corosync
Current DC: duck-03 (1) - partition with quorum
Version: 1.1.10-29.el7-368c726
2 Nodes configured
3 Resources configured


Online: [ duck-03 ]
Containers: [ duck-03-node01:R-duck-03-node01-lxc ]

Full list of resources:

 virt-fencing   (stonith:fence_ipmilan):        Started duck-03 
 R-duck-03-node01-lxc   (ocf::heartbeat:VirtualDomain): Started duck-03 

PCSD Status:
  duck-03: Online

Daemon Status:
  corosync: active/disabled
  pacemaker: active/disabled
  pcsd: active/enabled

duck-03# pcs resource show R-duck-03-node01-lxc
 Resource: R-duck-03-node01-lxc (class=ocf provider=heartbeat type=VirtualDomain)
  Attributes: hypervisor=lxc:/// config=/var/lib/libvirt/lxc/duck-03-node01.xml force_stop=true 
  Meta Attrs: remote-node=duck-03-node01 
  Operations: start interval=0s timeout=90000 (R-duck-03-node01-lxc-start-timeout-90000)
              stop interval=0s timeout=90000 (R-duck-03-node01-lxc-stop-timeout-90000)
              monitor interval=10 timeout=30 (R-duck-03-node01-lxc-monitor-interval-10)

Comment 6 Ludek Smid 2014-06-13 13:02:46 UTC
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.