How to auto start XEN VMs after reboot of DOM 0
来源:互联网 发布:织梦qq在线客服插件 编辑:程序博客网 时间:2024/05/20 11:34
How to auto start XEN VMs after reboot of DOM 0
This document (3466408) is provided subject to the disclaimer at the end of this document.
Environment
Novell SUSE Linux Enterprise Server 10 Service Pack 1Novell SUSE Linux Enterprise Server 10 Service Pack 2
Novell SUSE Linux Enterprise Server 10 Service Pack 1 XEN
Novell SUSE Linux Enterprise Server 10 Service Pack 2 XEN
Situation
After rebooting the SLES 10 XEN main OS, how can DomU virtual machines be started automatically?Resolution
general information:- Any DomU that has been "saved" using the xm save command will automatically be started at boot time when the xendomains service is on and requires no extra configuration.
- The method described in this TID are not recommended DomU's that is started as part of a high availability cluster or are managed by other programs such as ZenWorks Orchistrator
- Any DomU that was running before a graceful reboot, will start automatically and requires no extra configuration.
- Method 1 is for unmanaged domains or domains that use legacy /etc/xen/vm files
- Method 2 is the preferred method and is the most robust
- Method 3 uses the legacy /etc/xen/vm files and is not recommended unless ALL configuration changes are made using the legacy fil
- Make sure that the appropriate kernel is running.
- uname -r(The correct kernel should look something similar to 2.6.16-0.7- xen)
- If the version shown does not include"xen" go to step 2; otherwise go to step 3
- Edit the /boot/grub/menu.lst to boot off of the correct kernel (the XEN kernel)
- Change the "default #" line (where # represents a number starting with zero or higher) to point to the correct stanza representing the xen kernel
- EXAMPLE:
# Modified by YaST2. Last modification on Thu May 3 15:51:09 UTC 2007
default 1
timeout 8
gfxmenu (hd0,0)/message
title SUSE Linux Enterprise Server 10 SP1
root (hd0,0)
kernel /vmlinuz-2.6.16.46-0.7-smp root=/dev/disk/by-id/scsi-SATA_SAMSUNG_HD160JJS08HJ1OL323401-part2 vga=0x31a resume=/dev/sda3 splash=silent showopts
initrd /initrd-2.6.16.46-0.7-smp ###Don't change this comment - YaST2 identifier: Original name: xen###
title XEN
root (hd0,0)
kernel /xen.gz
module /vmlinuz-2.6.16.46-0.7-xen root=/dev/disk/by-id/scsi-SATA_SAMSUNG_HD160JJS08HJ1OL323401-part2 vga=0x31a resume=/dev/sda3 splash=silent showopts
module /initrd-2.6.16.46-0.7-xen
method 1: auto start DomU using legacy configuration files
The xendomains init script will over write any configuration changes made by the"xm”, YaST or "virt-manager”. This method is not the preferred method, as it creates an unmanaged domain (that is, the domain is not managed with xend). The init script uses the xm create command to create the domain as a brand-new configuration. Method 2 and Method create a managed domain, which is preferred.
initial configuration
- chkconfig --list | grep -i xen (xend and xendomains should be on)
- If the services are not turned to "on" for runlevels 3 and 5 then type:
- chkconfig xend on; chkconfig xendomains on
- Make sure the service is currenly running by typing:
- rcxend status; rcxendomains status
- If the services are not running, they can be turned on by the following:
- Change to the /etc/xen/vm directory
- cd /etc/xen/vm
- This directory will contain multiple files. For instance, if two virtual machines were installed with the names of vm1 and vm2, then the following files would be in the directory:
- v m1, vm1.xml, vm2, vm2.xml
- For the virtual machines that are to be auto-started after system reboot of Dom 0 (the main OS, or the host OS), create a soft link to the non-xml files to the /etc/xen/auto directory. Under SLES 10 SP2 the /etc/xen/auto directory does not exist. In order to use this method, you will need to create the directory (mkdir -p /etc/xen/auto)
- cd /etc/xen/auto/
- l n -s /etc/xen/vm/vm1 vm1
- In the case above (because only vm1 was copied, and not vm2), only vm1 will auto start after a system reboot of Dom 0.
This method uses the "xm” commands and is the only safe method to auto-start a DomU when the "xm”, YaST or"virt-manager” has been used to alter the guest configuration after the initial installation of the virtual machine. Since the the management database will be used to start the DomU, the "xendomains" init script can be safely turned off.
Replace SLES10 in the steps with the name of the virtual machine that you are configuring to start automatically.
- Export the virtual machines configruationxm list -l SLES10 > sles10
- Backup the file sles10, you may need it in the event that something is corrupted.
- Open the file sles10 for editing
Locate the line reading
(on_xend_start ignore)Change it to
(on_xend_start start)Locate the line reading
(on_xend_stop ignore)Change it to
(on_xend_stop shutdown)- Save the file
- Reimport the new configurationxm new -F sles10
method 3: use legacy configuation file and import it into the xen management database
This method involves changing the installation file used to create the DomU. This method is NOT recommended when "xm”, "YaST” or "virt-manager” has not been used to modify the DomU. This method is only recommended when DomU configuration changes have only been made through the installation file.Since the the management database will be used to start the DomU, the "xendomains" init script can be safely turned off.
- Shut down the DomU
- Locate the installation file, usually found in /etc/xen/vm
- Open the installation file for editing
- Add the following lines:on_xend_start="start"on_xend_stop="shutdown"
- Save and close the file
- Import the new configurationxm new -f
Additional Information
Key words for searchability:
xen
auto
start
autostart
reboot
Document
Document ID:3466408Creation Date:12-31-2007Modified Date:12-24-2008Novell Product:SUSE Linux Enterprise ServerDisclaimer
The Origin of this information may be internal or external to Novell. Novell makes all reasonable efforts to verify this information. However, the information provided in this document is for your information only. Novell makes no explicit or implied claims to the validity of this information.
Any trademarks referenced in this document are the property of their respective owners. Consult your product manuals for complete trademark information.
http://www.novell.com/support/viewContent.do?externalId=3466408&sliceId=1
- How to auto start XEN VMs after reboot of DOM 0
- EM 12c: OMS Failed to start After restarting the Repository Database or reboot of the server
- How to Ajax auto refresh after x seconds
- How to auto start Apache during boot time – Linux
- How to Clone VMs in ESXi
- How to close (auto hide) WPF window after 10 sec using a timer in C#?
- xen install VMs
- How to start/stop DB instance of Oracle under Linux
- how to use autologger in reboot trace
- How to reboot the system by apk
- auto login parallels vms
- How to use maven2.0 -quick start
- How to start SSHD
- How to start Rootkit
- How to start it?
- How to test VPNaaS using two KVM VMs (by quqi99)
- Vino& VNC server auto start after Ubuntu boot up
- List of Windows Auto Start Locations
- openGL学习笔记4(动画)
- C# 使用Graphics画图
- llinux的shell脚本编程详解
- C# 怎样让上下左右方向键生效
- S3C2440之UART操作(FIFO模式)
- How to auto start XEN VMs after reboot of DOM 0
- C#快捷菜单的添加
- 11步完成传感器SDK封装到OpenCV
- Android网络连接处理学习笔记
- 顺序队列出现假溢出现象的解决办法
- java的JDK安装
- Python : locals 和globals 以及反射(自省)
- 顺序队列的基本操作;
- input,我是不会让你记住我的行踪的