Changing XEN VM configuration

What is the correct way to update a XEN VM configuration?

In this case I want a specific domain to stop using /dev/emcpowerg and use /dev/emcpowerh in stead.

I have ensured that the two devices have identical geometry and have copied the contents from the one to the other (using dd)

Then I found two config files in /etc/xen/vm which refer /dev/emcpowerg and I replaced the g with an h in both places.

However when I run xm list --long domain_name|grep emc I still get the emcpowerg device name... So either there is another place where the config is stored .... or maybe some daemon has got a resident configuration kept in memory?

How do I correctly remove dependency on the old LUN/block device (the storage array is due to be decommissioned)

P.S. Note that the domain has been down for the entire operation.


Solution 1:

Ok this solves the riddle.

If xm list shows your DomU without ID this is a so-called "managed DomU".

In this case the configuration is permanently loaded into the xen-store.

To reload its configuration you need to issue xm delete for the DomU. After that use xm new to recreate it with the new settings (without starting it up).

Solution 2:

I found the correct solution - my initial surmise was correct - Xen does indeed store the VM configurations somewhere other than in /etc/xen/vm

The daemon Xend manages the configuration and editing the files located under /etc/xen/vm is not recommended as they are only used to create new VMs.

The process to change a VM configuration is

  1. Shut down the VM (DomU)

  2. Export the VM configuration to a text file with the command

    xm list -l DomU_name > vm.conf

  3. Use a text editor to edit file VM configuration, eg vi vm.conf

  4. Delete the VM from Xend and re-create it using the modified config file, using the following commands:

    xm del DomU_name xm new -F vm.conf

  5. Start the modified VM

    xm start DomU_name

This website, in particular this page, proved very useful: http://doc.opensuse.org/products/draft/SLES/SLES-xen_sd_draft/cha.xen.manage.html