• Managing your Xen DomU: Difference between "xm new" and "xm create"

    When you use Yast to "Create Virtual Machines", it does several things. For example, suppose you create a VM (DomU) called "oes11". The information you provide is saved in a file: /etc/xen/oes11. That information is also imported into the XenStore where it can be managed. You can then use "Virtual Machine Manager" to make changes to the DomU configuration saved in the XenStore. You can add devices, increase memory etc. but you will notice that none of those changes are reflected in /etc/xen/oes11.

    1. To see what DomU's are being managed by xend:
    Code:
    xm list
    2. To see the current xen configuration for your oes11 DomU:
    Code:
    xm list -l oes11
    (That's a lower case ELL after the "-")

    3. To save the current xen configuration for your oes11 DomU:
    Code:
    xm list -l oes11 >oes11.py
    the current xen configuration will be save to file oes11.py, in your current directory

    4. Now, if you no longer want xend to manage your oes11 Domu:
    Code:
    xm delete oes11
    Note: this doesn't delete the DomU or the virtual filestore. It just removes the definition from the XenStore.

    5. To verify that Xen no longer knows about your oes11 DomU:
    Code:
    xm list
    That will list all the DomU's managed by xend. oes11 is no longer listed.

    6. Even though the DomU is no longer managed by xend, you can still "run" it using the original configuration:
    Code:
    xm create /etc/xen/oes11
    7. You can also import the configuration back into the XenStore using the file created in step 3:
    Code:
    xm new -F oes11.py
    8. Step 7 just imports the configuration. It doesn't start the DomU. To start the DomU:
    Code:
    xm start oes11

    There are a few more important points to consider:
    • The XenStore contains the current configuration including changes made with "Virtual Machine Manager".
    • The file you use with xm create is static. It contains the initial configuration without any subsequent changes. For this reason it is often obsolete.
    • You are limited to making relatively simple changes to your DomU using "Virtual Machine Manager".



    This is the preferred method for changing your Xen configuration:

    A. Shutdown the DomU using the appropriate OS specific method or from the Dom0:
    Code:
    xm shutdown <DomU>
    B. Verify the DomU is no longer running:
    Code:
    xm list
    C. Save the current xen configuration for your DomU in a file:
    Code:
    xm list -l <DomU> > DomU.py
    D. Save a copy of the file (just in case!).

    E. Make any changes to the configuration using your favorite text editor and save the changes. <Modified Configuration>

    F. Delete the current configuration from the XenStore
    Code:
    xm delete <DomU>
    G. Import the modified configuration back into the XenStore using the file created in step E:
    Code:
    xm new -F <Modified Configuration>
    H. Start the DomU
    Code:
    xm start <DomU>
    An added benefit of following this procedure is you retain a backup copy of your DomU configuration should anything happen to the XenStore.