标签:kvm
让KVM实例在Host OS启动时,KVM里面的虚拟机也跟着自动启动,不需要我们人工的参与。root@kvm:~# virsh autostart kvm1
Domain kvm1 marked as autostarted
root@kvm:~# virsh dominfo kvm1
Id: 31
Name: kvm1
UUID: 6ad84d8a-229d-d1f6-ecfc-d29a25fcfa03
OS Type: hvm
State: running
CPU(s): 2
CPU time: 10.9s
Max memory: 2097152 KiB
Used memory: 1048576 KiB
Persistent: yes
Autostart: enable
Managed save: no
Security model: none
Security DOI: 0
root@kvm:~# virsh destroy kvm1
Domain kvm1 destroyed
root@kvm:~# virsh list --all
Id Name State
----------------------------------------------------
- kvm1 shut off
root@kvm:~# /etc/init.d/libvirt-bin stop
libvirt-bin stop/waiting
root@kvm:~# pgrep -lfa libvirtd
root@kvm:~# /etc/init.d/libvirt-bin start
libvirt-bin start/running, process 6639
root@kvm:~# virsh list --all
Id Name State
----------------------------------------------------
2 kvm1 running
root@kvm:~# virsh autostart kvm1 --disable
Domain kvm1 unmarked as autostarted
root@kvm:~# virsh dominfo kvm1 | grep -i autostart
Autostart: disable
标签:kvm
原文地址:http://blog.51cto.com/aishangwei/2124530