Hide Forgot
Description of problem: VirtualDomain resource agent will not start lxc container that is shut off only (instead of not being defined at all for virsh) after disabling the resource. Version-Release number of selected component (if applicable): resource-agents-3.9.5-15.el7.x86_64 pacemaker-1.1.10-15.el7.x86_64 pacemaker-cts-1.1.10-15.el7.x86_64 How reproducible: always Steps to Reproduce: 1. have lxc container generated by lxc_autogen.sh 2. start it as a resource v-lxc1 and verify that it runs and is recognized as remote node lxc1 3. pcs resource disable v-lxc1 4. virsh -c lxc:/// define /var/lib/pacemaker/cts/lxc/lxc1.xml 5. pcs resource enable v-lxc1 Actual results: resource will never start Expected results: started resource Additional info: It will start correctly that lxc container that is not defined in virsh. Selinux is off, virtual containers are created with pacemaker-cts lxc_autogen.sh.
libvirt domains managed by the VirtualDomain agent shouldn't be modified outside of the VirtualDomain agent. The VirtualDomain agent starts domains with the 'virsh create <domain.xml>' command. Domains initialized with this command are undefined on shutdown automatically. This means as long as this agent is used, no cluster lxc container should be defined anywhere except on the cluster it is currently active on. We do need to be able to handle the case where a user defines the domain outside of the agent. I believe the only way to handle this correctly is to undefine the domain on start, then enable the domain again using 'virsh create'. I'll write up a patch.
related upstream patch. https://github.com/davidvossel/resource-agents/commit/f00dcaf19467e3d96d9790d386b860b53ca381f9
I have verified that VirtualDomain resource can be enabled and starts correctly after being disabled in pacemaker after the domain has been started outside of pacemaker in resource-agents-3.9.5-26.el7.x86_64. ---- [root@duck-03 ~]# pcs resource R-duck-03-node01-lxc (ocf::heartbeat:VirtualDomain): Started [root@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) [root@duck-03 ~]# pcs resource disable R-duck-03-node01-lxc [root@duck-03 ~]# pcs resource R-duck-03-node01-lxc (ocf::heartbeat:VirtualDomain): Stopped [root@duck-03 ~]# virsh -c lxc:/// list Id Name State ---------------------------------------------------- [root@duck-03 ~]# virsh -c lxc:/// list --all Id Name State ---------------------------------------------------- [root@duck-03 ~]# virsh -c lxc:/// define /var/lib/libvirt/lxc/duck-03-node01.xml Domain duck-03-node01 defined from /var/lib/libvirt/lxc/duck-03-node01.xml [root@duck-03 ~]# pcs resource enable R-duck-03-node01-lxc [root@duck-03 ~]# pcs resource R-duck-03-node01-lxc (ocf::heartbeat:VirtualDomain): Started
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.