Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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.

share|improve this question
    
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 4 '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 5 '13 at 8:02

2 Answers 2

up vote 0 down vote accepted
+100

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

share|improve this answer

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

share|improve this answer
    
You should have read my answer (three hours before you solved it yourselv). –  Nils Mar 6 '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 6 '13 at 11:13
    
So +1 for your homework well done. ;-) –  Nils Mar 6 '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 7 '13 at 4: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 7 '13 at 20:51

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.