4

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.

Johan
  • 427
  • 1
  • 4
  • 14
  • Have you shut down the XEN DomU (xm shutdown) after changing the values? If you shutdown the DomU does the DomU still show up in `xm list`? – Nils Mar 04 '13 at 15:10
  • @Nils The DomU was shut down before I started the operation, and have not yet been started back up - it is just a test DomU, so it will stay down until I get a better understanding or guidance about what to do. In `xm list` it currently shows without an ID number (When running it gets an ID number) and no memory allocation, etc, but it is in the list. I don't know xen well enough to know whether that is good or bad. – Johan Mar 05 '13 at 08:02

2 Answers2

6

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

Johan
  • 427
  • 1
  • 4
  • 14
  • You should have read my answer (three hours before you solved it yourselv). – Nils Mar 06 '13 at 10:47
  • Actually I typed my answer about 99% finished a long time earlier but got interrupted. Then when I came back to finish up I saw the note "A new answer has been added", but I did not want to lose all may careful work, so I completed my answer despite yours, and the rest is history. – Johan Mar 06 '13 at 11:13
  • So +1 for your homework well done. ;-) – Nils Mar 06 '13 at 21:22
  • Heh :-) I almost did not allocate the bounty to you because reading my question and your answer, I think you should have known this at the time you made the original comment and you could have saved me quite some pain if you gave this answer earlier. – Johan Mar 07 '13 at 04:23
  • Well yes and no. Sometimes my first assumptions are wrong, so I had to be sure that you are encountering this problem. And I am trying not to do SF or UL as full-time-job... – Nils Mar 07 '13 at 20:51
  • Yes, Trying.... I know exactly where you are coming from! – Johan Mar 08 '13 at 08:00
2

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).

Nils
  • 7,657
  • 3
  • 31
  • 71