Bug 488024 - [RFE] check "name" in Xen configuration before starting a VM
Summary: [RFE] check "name" in Xen configuration before starting a VM
Keywords:
Status: CLOSED DUPLICATE of bug 412911
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: rgmanager
Version: 5.3
Hardware: All
OS: Linux
low
medium
Target Milestone: rc
: ---
Assignee: Lon Hohberger
QA Contact: Cluster QE
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-03-02 08:55 UTC by Carsten Clasohm
Modified: 2016-04-26 13:47 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-05-14 16:11:23 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Carsten Clasohm 2009-03-02 08:55:05 UTC
Description of problem:

When the administrator makes a mistake while moving files around, and sets the "name" parameter in cluster.conf to a value different from the "name" parameter in the guest configuration, rgmanager starts the guest on multiple cluster nodes, causing filesystem corruption.

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

rgmanager-2.0.46-1.el5

How reproducible:

always

Steps to Reproduce:
1. outside of the cluster, create a Xen guest named "foo"

2. move the Xen configuration file "foo" from /etc/xen to your shared storage, and call the target file "bar"; leave the name parameter inside the file set to "foo"

3. add the virtual machine in cluster.conf, setting the name to "bar"

4. activate the "bar" cluster service

Actual results:

rgmanager starts the guest on node A. The next status call for guest "bar" returns 1, so node A tries to restart the guest. This fails because Xen sees that guest "foo" is already running. The service is relocated to another cluster node, and the virtual machine is started on multiple hosts in parallel.

Expected results:

It would be nice if vm.sh checked the name parameter in the Xen configuration file before starting the guest. While this is a mistake made by the administrator, the consequences are quite severe.

Comment 1 Perry Myers 2009-04-02 16:40:17 UTC
Right, so either we need to:
1. enforce that the config file name is the same as the guest name
2. ignore the config file name and use the name parameter as provided by either the xm configuration file or the libvirt xml file

I think #2 is the right solution here.  So vm.sh should parse the xm or libvirt config file to extract the vm name instead of assuming vm name is the same as filename.

Comment 2 Lon Hohberger 2009-05-14 16:11:23 UTC
Virsh does #2.  Therefore, there is no work to be done on this bugzilla.


[root@marge xen]# mv r5filebacked1 r5furious_awesomeness_config_file_name
[root@marge xen]# virsh list
 Id Name                 State
----------------------------------
  0 Domain-0             running
 16 r5filebacked0        idle

[root@marge xen]# virsh list --all
 Id Name                 State
----------------------------------
  0 Domain-0             running
 16 r5filebacked0        idle
  - r51pv2               shut off
  - r5filebacked1        shut off
  - r5filebacked2        shut off
  - r5filebacked3        shut off
  - r5filebacked4        shut off
  - rendertest           shut off
  - rhel4domU0           shut off

[root@marge xen]# virsh start r5filebacked1
Domain r5filebacked1 started

[root@marge xen]# virsh destroy r5filebacked1
Domain r5filebacked1 destroyed

[root@marge xen]# xm create r5filebacked1
Error: Unable to open config file: r5filebacked1

*** This bug has been marked as a duplicate of bug 412911 ***

Comment 3 Lon Hohberger 2009-05-14 16:13:59 UTC
Making vm.sh parse all domain names in the path spec is going to be inefficient and error-prone; therefore, users wishing to use filenames which differ from their domain name must use virsh.


Note You need to log in before you can comment on or make changes to this bug.