![KVM 虚拟客户机在重启时暂停](https://linux22.com/image/534326/KVM%20%E8%99%9A%E6%8B%9F%E5%AE%A2%E6%88%B7%E6%9C%BA%E5%9C%A8%E9%87%8D%E5%90%AF%E6%97%B6%E6%9A%82%E5%81%9C.png)
我正在运行 REHL 6,刚刚通过设置为在启动时启动的 KVM 安装了一个 Ubuntu Server Guest。这可以正常工作,Guest 可以加载,但它加载时“已暂停”,需要我手动取消暂停。有人能给我提示一下如何让 Guest OS 在启动时真正处于活动状态吗?
这是所要求的 libvert 转储...还尝试了 libvert 自动启动 --- 没有效果。
<domain type='kvm' id='1'>
<name>MailServer</name>
<uuid>a61dae75-1f5c-d536-718f-3c615d9b4868</uuid>
<memory>4194304</memory>
<currentMemory>4194304</currentMemory>
<vcpu>4</vcpu>
<os>
<type arch='x86_64' machine='rhel6.0.0'>hvm</type>
<boot dev='hd'/>
</os>
<features>
<acpi/>
<apic/>
<pae/>
</features>
<clock offset='utc'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<devices>
<emulator>/usr/libexec/qemu-kvm</emulator>
<disk type='file' device='disk'>
<driver name='qemu' type='raw' cache='none'/>
<source file='/home/MailServer/MailServer-1.img'/>
<target dev='hda' bus='ide'/>
<alias name='ide0-0-0'/>
<address type='drive' controller='0' bus='0' unit='0'/>
</disk>
<disk type='block' device='cdrom'>
<driver name='qemu' type='raw'/>
<target dev='hdc' bus='ide'/>
<readonly/>
<alias name='ide0-1-0'/>
<address type='drive' controller='0' bus='1' unit='0'/>
</disk>
<controller type='ide' index='0'>
<alias name='ide0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
</controller>
<interface type='bridge'>
<mac address='52:54:00:cd:f9:9f'/>
<source bridge='br0'/>
<target dev='vnet0'/>
<model type='virtio'/>
<alias name='net0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
</interface>
<serial type='pty'>
<source path='/dev/pts/1'/>
<target port='0'/>
<alias name='serial0'/>
</serial>
<console type='pty' tty='/dev/pts/1'>
<source path='/dev/pts/1'/>
<target port='0'/>
<alias name='serial0'/>
</console>
<input type='mouse' bus='ps2'/>
<graphics type='vnc' port='5900' autoport='yes'/>
<sound model='ac97'>
<alias name='sound0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
</sound>
<video>
<model type='cirrus' vram='9216' heads='1'/>
<alias name='video0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
</video>
<memballoon model='virtio'>
<alias name='balloon0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
</memballoon>
</devices>
<seclabel type='dynamic' model='selinux'>
<label>system_u:system_r:svirt_t:s0:c211,c271</label>
<imagelabel>system_u:object_r:svirt_image_t:s0:c211,c271</imagelabel>
</seclabel>
</domain>
答案1
这可能不是最好的解决方案,但我确实解决了这个问题。我添加了:virsh resume MailServer &> /var/log/MailServer.log 到 /etc/rc.d/rc.local
这可能不是强制启动的最优雅的方式..但它有效:)。
谢谢您的帮助。
答案2
如果你知道你的域名,你可以这样做
virsh autostart Domain