`

使用libvirt管理kvm虚拟机

 
阅读更多
说明:这篇笔记为更好的管理虚拟化服务,如果仅仅是测试虚拟化,查看另一篇笔记:
 
web方式管理虚拟机,查看:
 
补充:这篇笔记使用的libvirt版本为0.6.3,kernel为2.6.18-194.26.1.el5
遇到了几个bug,建议首先升级kernel,然后升级libvirt,kvm。
yum clean all
yum makecache 
yum list kernel
20110428:kernel 2.6.18-238.9.1.el5
 
yum update kernel kernel-devel.x86_64 kernel-headers.x86_64
 
 
一、安装虚拟化管理工具
1、yum install virt-manager libvirt libvirt-python python-virtinst
  1. 1、kmod-kvm : kvm kernel module(s)
  2. 2、kvm : Kernel-based Virtual Machine
  3. 3、kvm-qemu-img : Qemu disk image utility
  4. 4、kvm-tools : KVM debugging and diagnostics tools
  5. 5、python-virtinst : Python modules and utilities for installing virtual machines
  6. 6、virt-manager : Virtual Machine Manager (GUI app, to install and configure VMs)
  7. 7、virt-viewer: Virtual Machine Viewer (another lightweight app to view VM console and/or install VMs)
  8. 9、bridge-utils : Utilities for configuring the Linux Ethernet bridge (this is recommended for KVM networking)
KVM Package GroupRHEL comes with KVM software group which includes full virtualization support with KVM. You can list all packages in the group as follows:

# yum groupinfo KVM

 
2、Start the libvirtd daemon service
service libvirtd start
 
关于错误:
注:该错误出现在centos5.4,libvirtd 0.6.3
重启libvirtd后,启动guest时会出现下面的问题。
Apr 22 09:16:20 srv4 kernel: libvirtd[27156]: segfault at 00000000444e3000 rip 0000003e5501e161 rsp 00000000444dfcd0 error 4
Apr 22 09:16:20 srv4 libvirtd: 09:16:20.739: error : internal error Unable to daemonize QEMU process 
重启了host,问题解决
原因:https://bugzilla.redhat.com/show_bug.cgi?id=505625
Everytime the virGetCapabilities() method is run, it destroys the existing virCapsPtr object and creates it again....without any of the selinux info. virt-manager runs this method. so once virt-manager has run, subsequent calls to get the security info will give the crash you see.
 
二、有关网络
1、一般网络(又名NAT):guest可以访问外网,外网不能访问guest。
安装了libvirt后,一个NAT网络即可用。host被设置为192.168.122.1(virbr0),所有的guest将被分配为192.168.122.x
如果看不到virbr0
或者在virsh start 时出现下面的错误:
Apr 22 08:50:37 srv4 libvirtd: 08:50:37.839: error : internal error Failed to add tap interface 'vnet%d' to bridge 'virbr0' : No such device 
 
查看/var/log/message.log
Apr 22 08:57:10 srv4 dnsmasq[26000]: failed to open pidfile /var/run/libvirt/network/default.pid: Permission denied
Apr 22 08:57:10 srv4 dnsmasq[26000]: FAILED to start up
 
手动启动default network
virsh net-start default
error: Failed to start network default
error: internal error '/usr/sbin/dnsmasq --strict-order --bind-interfaces --pid-file=/var/run/libvirt/network/default.pid --conf-file=  --listen-address 192.168.122.1 --except-interface lo --dhcp-range 192.168.122.2,192.168.122.254 --dhcp-lease-max=253' exited with non-zero status 3 and signal 0: 
dnsmasq: failed to open pidfile /var/run/libvirt/network/default.pid: Permission denied
解决办法:
我的当前系统:selinux-policy.noarch                                               2.4.6-203.el5  
yum updata selinux-policy.noarch
selinux-policy.noarch                                               2.4.6-279.el5_5.2 
 
service libvirtd restart
注:需要重启host,上面写了原因
  1. # ifconfig virbr0
  2. virbr0 Link encap:Ethernet HWaddr 00:00:00:00:00:00
  3. inet addr:192.168.122.1 Bcast:192.168.122.255 Mask:255.255.255.0
  4. inet6 addr: fe80::200:ff:fe00:0/64 Scope:Link
  5. UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
  6. RX packets:0 errors:0 dropped:0 overruns:0 frame:0
  7. TX packets:57 errors:0 dropped:0 overruns:0 carrier:0
  8. collisions:0 txqueuelen:0
  9. RX bytes:0 (0.0 b) TX bytes:10962 (10.7 KiB)
一个故障:
不论是NAT,还是Bridge模式,guest都无法与其他服务器通信,而且NAT模式时无法通过dhcp获取IP。没有查到错误原因。
不使用virsh来启动,按照http://blog.chinaunix.net/space.php?uid=1838361&do=blog&id=234090文章介绍的方法来启动时,NAT及bridge模式都可以正常访问其他服务器。所以按照该文章的方法,在guest的xml文件中定义interface的部分,指定虚拟网卡为tap0,网络正常了,将指定的网卡名去掉,由virsh自动分配为vnet0,网络也是正常的,也可以通过dhcp获取IP了。原因未知。
另:virsh启动的log文件位于:/var/log/libvirt/qemu/
 
20110711:
nat方式无法获取IP,service libvirtd restart 重启服务,恢复。
 
关于NAT方式,guest可以获取ip,但无法与访问公网:
有多个网卡?你的物理机由哪个网卡访问公网?例如,我的物理机由br0访问公网,则,修改default.xml文件,添加forward的dev参数。
  1. virsh # net-dumpxml default
  2. <network>
  3.   <name>default</name>
  4.   <uuid>8d004490-ee73-4e36-b9ef-821d7e73f9f6</uuid>
  5.   <forward dev='br0' mode='nat'/>
  6.   <bridge name='virbr0' stp='on' forwardDelay='0' />
  7.   <ip address='192.168.122.1' netmask='255.255.255.0'>
  8.     <dhcp>
  9.       <range start='192.168.122.2' end='192.168.122.254' />
  10.     </dhcp>
  11.   </ip>
  12. </network>
  1. virsh # net-define /etc/libvirt/qemu/network/default.xml
  2. virsh # net-destroy default
  3. virsh # net-start  default
 
2、Bridge网络(又名:共享物理网卡):guest可以访问外网,外网也可以访问guest
# cd /etc/sysconfig/network-scripts/
cp ifcfg-eth0 ifcfg-br0 
两个配置文件内容分别为:
/etc/sysconfig/network-scripts/ifcfg-eth0
  1. DEVICE=eth0
  2. TYPE=Ethernet
  3. ONBOOT=yes
  4. NM_CONTROLLED=no
  5. BRIDGE=br0
/etc/sysconfig/network-scripts/ifcfg-br0
  1. DEVICE=br0
  2. TYPE=Bridge
  3. NM_CONTROLLED=no
  4. BOOTPROTO=static
  5. IPADDR=221.193.136.121
  6. NETMASK=255.255.255.0
  7. ONBOOT=yes
The NM_CONTROLLED=no option was added because both device should not be controlled by the Network Manager for bridge to work. 
 
重启network(当前连接会丢失,确保你总是可以访问host,否则要格外小心
service network restart
 
关于错误:Bringing up interface eth0:  tg3 device eth0 does not seem to be present, delaying initialization.
原因:br0里没有加配置 TYPE=Bridge
 
对于rhel6和centos6,需要关闭NetworkManager 
service NetworkManager stop
chkconfig --level 35 NetworkManager off
 
Disable Netfilter processing in the bridged traffic.
/etc/sysctl.conf文件中添加:
  1. net.bridge.bridge-nf-call-ip6tables = 0
  2. net.bridge.bridge-nf-call-iptables = 0
  3. net.bridge.bridge-nf-call-arptables = 0
  4. net.bridge.bridge-nf-filter-vlan-tagged = 0
 
        验证是否生效
ifconfig
br0现在扮演eth0的角色。
br0       Link encap:Ethernet  HWaddr 00:14:5E:C2:1E:40  
          inet addr:221.193.136.121   Bcast:221.193.136.255  Mask:255.255.255.0 
          inet6 addr: fe80::214:5eff:fec2:1e40/64 Scope:Link 
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1 
          RX packets:125 errors:0 dropped:0 overruns:0 frame:0 
          TX packets:81 errors:0 dropped:0 overruns:0 carrier:0 
          collisions:0 txqueuelen:0 
          RX bytes:16078 (15.7 KiB)  TX bytes:18542 (18.1 KiB) 
eth0      Link encap:Ethernet  HWaddr 00:14:5E:C2:1E:40  
          inet6 addr: fe80::214:5eff:fec2:1e40/64 Scope:Link 
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1 
          RX packets:206 errors:0 dropped:0 overruns:0 frame:0 
          TX packets:58 errors:0 dropped:0 overruns:0 carrier:0 
          collisions:0 txqueuelen:1000 
          RX bytes:27308 (26.6 KiB)  TX bytes:13881 (13.5 KiB) 
          Interrupt:74 Memory:da000000-da012800
 
也可以通过下面的命令查看桥接网络,可以看到eth0加到了桥接设备br0中:
# brctl show
bridge name     bridge id               STP enabled     interfaces
virbr0          8000.000000000000       yes
br0             8000.000e0cb30550       no              eth0
 
 
三、创建KVM虚拟机的XML定义文件
关于KVM XML format  http://libvirt.org/formatdomain.html 
1.1 用于从磁盘启动的XML文件
1、kvm guest 定义开始
  1. <domain type='kvm'>
2、guest的short name。由字母和数字组成,不能包含空格
  1. <name>centosvm1</name>
3、uuid,由命令行工具 uuidgen生成。
  1. <uuid>bdbb89fb-57d1-4d01-b3b7-ff33a9346ae6</uuid>
4、在不reboot guest的情况下,guset可以使用的最大内存,以KB为单位
  1. <memory>2048000</memory>
5、guest启动时内存,可以通过virsh setmem来调整内存,但不能大于最大可使用内存。
  1. <currentMemory>1024000</currentMemory>
6、分配的虚拟cpu
  1. <vcpu>2</vcpu>
7、有关OS
x86架构:i686  
 
hvm:全虚拟化
 
kernel:指定guest使用的内核,如果使用ISO(安装时)或guset系统中(系统已经安装完成)的内核,不需要指定该项
initrd:指定guest使用的ram disk,如果使用ISO(安装时)或guest系统中(系统已经安装完成)的ram disk,不需要指定该项
注:kernel 和initrd文件位于RHEL系统光盘的images/pxeboot目录,拷贝这两个文件到本地磁盘,并指定路径。
注:这两个元素,如果是为了安装guset而指定,在安装完成以后即可以删除。
如果host开启了SELINUX,you also need to change the type of security context for the files to virt_image_t to allow libvirtd to access them for booting: 
  1. # chcon -t virt_image_t /tmp/vmlinuz-rhel54
  2. # chcon -t virt_image_t /tmp/initrd-rhel54.img
After you change the security context, verify that the correct security context is assigned to them as shown in the following example: 
  1. # ls -Z /tmp|grep virt
  2. -r--r--r-- root root root:object_r:virt_image_t initrd-rhel54.img
  3. -r--r--r-- root root root:object_r:virt_image_t vmlinuz -rhel54
boot:指定启动设备,可以重复多行,指定不同的值,作为一个启动设备列表。
可以在cmdline元素中添加启动参数,例如,使用kickstart文件:
method=http://10.1.1.212/install/rhel5.4/x86_64 
ks=http://10.1.1.212/install/autoinst/c20m2n05v3
  1. <os>
  2.       <type arch='x86_64' machine='pc'>hvm</type>
  3.       <kernel>/tmp/vmlinuz-rhel54</kernel>
  4.       <initrd>/tmp/initrd-rhel54.img</initrd>
  5.       <boot dev='hd'/>
  6.     </os>
 
8、处理器特性
  1. <features>
  2.       <acpi/>
  3.       <apic/>
  4.       <pae/>
  5.     </features>
关于处理器特性,查看:
 
9、时钟。使用本地时间:localtime
   
 
仍然需要再计划任务中添加时间同步:
*/15 * * * * (/usr/sbin/ntpdate 210.72.145.44 > /dev/null 2>&1;/sbin/hwclock -w)
 
10、定义了在kvm环境中power off,reboot,或crash时的默认的动作为destroy。其他允许的动作包括:restart,preserve,rename-restart.
在这个例子中,destory之所以也用在了on_reboot元素中,是因为一旦安装完成,期望的guest动作是stop,以便从the installed guest operating system而不是从the installation kernel or ISO编辑guest的定义。
destroy:停止该虚拟机。相当于关闭电源
  1.     <on_poweroff>destroy</on_poweroff>
  2.     <on_reboot>destroy</on_reboot>
  3.     <on_crash>destroy</on_crash>
11、设备定义开始
  1. <devices>
12、模拟元素,此处写法用于kvm的guest(xen怎么写?)
  1. <emulator>/usr/libexec/qemu-kvm</emulator>  
13、用于kvm存储的文件。在这个例子中,在guest中显示为IDE设备。
使用qemu-img命令创建该文件,kvm image的默认目录为:/var/lib/libvirt/images/
  1. <disk type='file' device='disk'>
  2.  cache='none'/>
  3.         <source file='/var/lib/libvirt/images/kvm3.img'/>
  4.         <target dev='hda' bus='ide'/>
  5.       </disk>
这里需要注意:使用libvirt 0.6.3写的xml,没有参数,当将该xml放到libvirt 0.8版本时,该参数会默认为raw,所以会造成在0.6中可以启动的guest无法启动,更改参数即可
使用virtio:
采用普通的驱动,即硬盘和网卡都采用默认配置情况下,硬盘是 ide 模式,而网卡工作在 模拟的rtl 8139 网卡下,速度为100M 全双工。采用 virtio 驱动后,网卡工作在 1000M 的模式下,硬盘工作是SCSI模式下。
  1. <disk type='file' device='disk'>
  2.    <driver name='qemu' type='raw' cache='none'/>
  3.    <source file='/usr/local/kvm/vmsample/disk.os'/>
  4.    <target dev='vda' bus='virtio'/>
  5. </disk>
硬盘采用 virtio 后,安装windows 系统,将不能正常的识别硬盘,解决的方法是:
从kvm 的官网下载virtio的驱动iso。
1. 先采用ide模式安装系统。
2. 安装完成后,添加一个virtio模式的硬盘。
3. 启动vm后,系统会自动搜索 SCSI的驱动,找到下载的virtio 驱动后,安装即可。
4. 修改vm 配置文件,删除掉添加的 vitro 硬盘后,修改ide硬盘为 virtio模式即可。
 
A Note About Virtio Drivers

Virtio is paravirtualized drivers for kvm/Linux. With this you can can run multiple virtual machines running unmodified Linux or Windows VMs. Each virtual machine has private virtualized hardware a network card, disk, graphics adapter, etc. According to Redhat:

Para-virtualized drivers enhance the performance of fully virtualized guests. With the para-virtualized drivers guest I/O latency decreases and throughput increases to near bare-metal levels. It is recommended to use the para-virtualized drivers for fully virtualized guests running I/O heavy tasks and applications. 

 
关于cache=none
如果不加该参数,默认cache policy为write through。
kvm官方及IBM都推荐使用raw,设置cache为none,以关闭kvm磁盘的cache策略,让数据可以直接落在实体硬盘上(实体机上其实也有磁盘cache的,并不需要kvm为cache操心)
For the best storage performance on guest operating systems that use raw disk volumes or partitions,completely avoid the page cache on the host.
下面的帖子中有一段关于cache的内容:
 
  
补充:可以定义多个磁盘,其他可行的磁盘定义:
Logical volume device:
  1. <disk type='block' device='disk'>
  2.             <source 'dev=/dev/mapper/VolGroup01-LVM1'/>
  3.             <target dev='hdb'/>
  4.         </disk>
Disk partition:
  1. <disk type='block' device='disk'>
  2.             <source dev='/dev/sda4'/>
  3.             <target dev='hdb' bus='ide'/>
  4.         </disk>
CD-ROM device:
  1. <disk type='block' device='cdrom'>
  2.             <source 'dev=/dev/sde'>
  3.             <target dev='hdb'/>
  4.             <readonly/>
  5.         </disk>
  
  14、使用网桥类型。确保每个kvm guest的mac地址唯一。将创建tun设备,名称为vnetx(x为0,1,2...)
  1. <interface type='bridge'>
  2.         <source bridge='br0'/>
  3.         <mac address="3B:6E:01:69:3A:11"/>
  4. </interface>
 补充:使用默认的虚拟网络代替网桥,即guest为NAT模式。也可以省略mac地址元素,这样将自动生成mac地址。
  1. <interface type='network'>
  2.             <source network='default'/>
  3.             <mac address="3B:6E:01:69:3A:11"/>
  4.         </interface>
  默认分配192.168.122.x/24的地址,也可以手动指定。网关为192.168.122.1
 
使用virtio:
采用普通的驱动,即硬盘和网卡都采用默认配置情况下,硬盘是 ide 模式,而网卡工作在 模拟的rtl 8139 网卡下,速度为100M 全双工。采用 virtio 驱动后,网卡工作在 1000M 的模式下,硬盘工作是SCSI模式下。
rhel5.6 guest with virtio interface can not boot successfully if the system installation would use the ide interface
 
  1. <interface type='bridge'>
  2.    <source bridge='br1'/>
  3.    <model type='virtio' />
  4. </interface>
性能:通过物理机上拷贝
普通驱动:26.1M
virtio驱动:44.7M  
因为交换机为100M,无法测试从其他物理机上拷贝。
 
  15、输入设备
  1. <input type='mouse' bus='ps2'/>
  
  16、定义与guset交互的图形设备。在这个例子中,使用vnc协议。listen的地址为host的地址。prot为-1,表示自动分配端口号,通过以下的命令查找端口号:
virsh vncdisplay     
注意:是passwd 而不是password 
VNC is configured to listen on 127.0.0.1 by default. To make it listen on all public interfaces, edit /etc/libvirt/qemu.conf file.
  1. <graphics type='vnc' listen='221.191.134.123' passwd='123456' port='-1' autoport='yes' keymap='en-us'/>  
  17、设备定义结束
  1. </devices>
18、KVM定义结束
  1. </domain>
  完整的xml
  1. <domain type='kvm'>
  2.   <name>centoskvm3</name>
  3.   <uuid>bdbb89fb-57d1-4d01-b3b7-ff33a9346ae6</uuid>
  4.   <memory>2048000</memory>
  5.   <currentMemory>1024000</currentMemory>
  6.   <vcpu>2</vcpu>
  7.   <os>
  8.     <type arch='x86_64' machine='pc'>hvm</type>
  9.     <boot dev='hd'/>
  10.   </os>
  11.   <features>
  12.     <acpi/>
  13.     <apic/>
  14.     <pae/>
  15.   </features>
  16.   <clock offset='localtime'/>
  17.   <on_poweroff>destroy</on_poweroff>
  18.   <on_reboot>restart</on_reboot>
  19.   <on_crash>destroy</on_crash>
  20.   <devices>
  21.     <emulator>/usr/libexec/qemu-kvm</emulator>
  22.     <disk type='file' device='disk' cache='none'>
  23.       <source file='/usr/local/kvm/centvm3.img'/>
  24.       
  25.     </disk>
  26.     <interface type='bridge'>
  27.       <mac address='3b:6e:01:69:3a:11'/>
  28.       <source bridge='br0'/>
  29.      
  30.     </interface>
  31.     <input type='mouse' bus='ps2'/>
  32.     <graphics type='vnc' port='-1' autoport='yes' listen='221.196.131.121' keymap='en-us' passwd='123456'/>
  33.   </devices>
  34. </domain>
  1.2 用于从ISO启动的XML文件
virt-install --name vm1 --ram 512 --disk path=/usr/local/kvm/vm1/disk.os,size=10 --accelerate --cdrom=/usr/local/centos5.6/CentOS-5.6-x86_64-bin-DVD-1of2.iso --vnc 0.0.0.0:3
  1. <domain type='kvm'>
  2.   <name>vmsample</name>
  3.   <uuid>fee1dfbb-a8f8-9144-d15a-852dbc175219</uuid>
  4.  <memory>2677721</memory>
  5.   <currentMemory>2677312</currentMemory>
  6.   <vcpu>2</vcpu>
  7.   <os>
  8.     <type arch='x86_64' machine='rhel5.4.0'>hvm</type>
  9.     <boot dev='cdrom'/>
  10.   </os>
  11.   <features>
  12.     <acpi/>
  13.     <apic/>
  14.     <pae/>
  15.   </features>
  16.   <clock offset='localtime'>
  17.     <timer name='pit' tickpolicy='delay'/>
  18.   </clock>
  19.   <on_poweroff>destroy</on_poweroff>
  20.   <on_reboot>destroy</on_reboot>
  21.   <on_crash>destroy</on_crash>
  22.   <devices>
  23.     <emulator>/usr/libexec/qemu-kvm</emulator>
  24.     <disk type='file' device='disk'>
  25.       <driver name='qemu' type='raw' cache='none'/>
  26.       <source file='/usr/local/kvm/vmsample/disk.os'/>
  27.         <target dev='vda' bus='virtio'/>
  28.     </disk>
  29.    
  30.      <source file="/usr/local/centos5.6/CentOS-5.6-x86_64-bin-DVD-1of2.iso" style="word-wrap: break-word;"></source>
  31.      
  32.      
  33.    
  34.     <interface type='bridge'>
  35.       <source bridge='br0'/>
  36.       <model type='virtio' />
  37.     </interface>
  38.     <interface type='bridge'>
  39.       <source bridge='br1'/>
  40.       <model type='virtio' />
  41.     </interface>
  42.     <input type='mouse' bus='ps2'/>
  43.     <graphics type='vnc' port='-1' autoport='yes' listen='1.1.1.1' passwd='11111v' keymap='en-us'/>
  44.     <video>
  45.       <model type='cirrus' vram='9216' heads='1'/>
  46.     </video>
  47.   </devices>
  48. </domain>
启动后,磁盘空间为0?进入virsh ,etdi 虚拟机.xml,查看磁盘类型,为raw?你创建的磁盘是qcow2? 
四、 使用virsh创建一个kvm虚拟机
 当创建或编辑了一个kvm xml文件后,使用virsh tool创建kvm。
 1、定义KVM
virsh define
For example:
# virsh define /usr/local/kvm/centvm3.xml
在后台,这个命令拷贝该xml文件到/etc/libvirt/qemu目录,文件名为xml里定义的kvm名称。并且正式定义一个新的kvm。
 
如何修改?
方法1:
virsh edit
virsh define
 
方法2:
virsh undefine
virsh define
 
2、启动KVM
virsh start
For example:
# virsh start centosvm3
 
 
查看vnc信息:
virsh vncdisplay centosvm3
 
也可以通过virt-viewer查看
virt-viewer
 
关闭kvm虚拟机:virsh destory
 
查看运行中的虚拟机:
virsh list
 
3、克隆虚拟机
virt-clone -o vm1 -n vm2 -f /usr/local/kvm/vm2/disk.os /usr/local/kvm/vm2/disk.data -d --prompt
因为我的vm1虚拟机有两个磁盘,所以,在克隆时需要制定两个磁盘文件,如果你不清楚顺序,可以将-f部分去掉,后面的--prompt,交互式,可以根据提示输入磁盘文件。
注意:克隆的xml文件会丢失vnc的passwd参数,需要手动添加。
 
克隆后,某个磁盘变为实际使用的大小?
qemu-img create -F qcow2 -b ./disk.data.1 -f raw disk.data 80G
 
错误:
在convert 或 create时,报错:
qemu-img could not open 磁盘文件
问题:当 qemu-img info 磁盘文件存在backing file 项时,会报这个错误。
backing file 来源:当使用qemu-img create创建磁盘时,会创建这个项
另外:当虚拟机正在使用该磁盘时,qemu-img info 磁盘文件时,也会出现这个错误。
 
关于qemu-img convert:
会创建新格式的磁盘,旧格式的磁盘仍然存在。
 
关于error: unknown OS type hvm
kernel没有加载模块,检查bios里是否开启了虚拟化
 
 
杂项:
1、关闭guest的磁盘监控
# service smartd stop # chkconfig --del smartd
 
 
一篇不错的文章:
http://www.cyberciti.biz/faq/centos-rhel-linux-kvm-virtulization-tutorial/
分享到:
评论

相关推荐

    使用libvirt管理kvm虚拟机.txt

    Libvirt 库是一种实现 Linux 虚拟化功能的 Linux® API,它支持各种虚拟机监控程序,包括 Xen 和 KVM,以及 QEMU 和用于其他操作系统的一些虚拟产品。现在许多开源项目如:virt-manager和virt-install采用libvirt做...

    virt-backup:备份由libvirt管理的kvm guest虚拟机

    虚拟备份 使用BlockCommit功能对由libvirt管理的KVM guest虚拟机进行外部备份。 主要目标是为Proxmox VE备份系统(无vma系统)做一个适度的替代方案,以自动备份磁盘(使用可选压缩)并轻松还原磁盘。 来宾是按组...

    virt-manager:通过libvirt管理虚拟机的桌面工具

    大多数使用QEMU / KVM虚拟机,但是Xen和libvirt LXC容器受到很好的支持。 任何libvirt驱动程序的通用操作都应该起作用。 还提供了几种命令行工具: virt-install :创建新的libvirt虚拟机virt-clone :复制现有的...

    Virtlyst:使用 libvirt 管理虚拟机的 Web 界面

    使用 libvirt 管理虚拟机的 Web 界面 不要让您的虚拟化管理使用比主要虚拟化需求更多的资源。 非常适合简单性是虚拟化使用关键的小型部署 内存占用低,使用大约 5 MiB 的 RAM CPU使用率低 使用模板轻松定制外观和...

    vmdashboard:QEMU和KVM虚拟机的基于Web的开源虚拟化管理界面

    VM Dashboard是基于Web的前端,用于基于libvirt的KVM虚拟机。 有关Ubuntu和CentOS的设置说明,请访问 软件新手? 可以在上查看屏幕截图

    KVM虚拟机技术学习总结

    KVM虚拟机的管理主要是通过virsh命令对虚拟机进行管理。 1. 查看KVM虚拟机配置文件及运行状态 (1) KVM虚拟机默认配置文件位置: /etc/libvirt/qemu/ autostart目录是配置kvm虚拟机开机自启动目录。  (2) virsh...

    国产化(飞腾+kylin)计算节点纳管虚拟化层适配详细设计_v1.0.docx

    信创(飞腾+kylin)虚拟化层适配,目标:在飞腾+kylin的服务器上通过libvirt创建kvm虚拟机,其中,libvirt 5.5.0、 QEMU 4.0.1

    kvm-controller:从裸机控制kvm虚拟机实例

    KVM虚拟机运维脚本初始化KVM主机机,并准备KVM环境实现自动化安装KVM虚拟机,并完成初始化工作功能列表可以连接vncserver;可声明式批量定制裸机上的虚拟机;配置主机机器网络根据参数,Provisioning虚拟机;支持的...

    linux下配置和安装KVM虚拟机的步骤

    最近要在外网搞一套监控系统,正好有一台服务器配置比较高,也没跑什么重要的业务,就拿来划了一个KVM虚拟机,可能是平时各种虚拟机用的比较多,配置起来感觉比想象中简单的多,简单记录下过程 准备工作 宿主机为...

    kvmtop:KVM虚拟机管理程序级别的黑盒虚拟机监视工具

    kvmtop的作用kvmtop从Linux proc文件系统和libvirt中读取有关在KVM虚拟机管理程序上运行的虚拟机的利用率指标。 为什么还要使用另一个虚拟机监视工具? Kvmtop考虑了虚拟机内部和外部利用率之间的差异,在超额配置的...

    详解基于本地存储的kvm虚拟机在线迁移

    kvm虚拟机迁移分为4种 (1)热迁移基于共享存储 (2)热迁移基于本地存储 (3)冷迁移基于共享存储 (4)冷迁移基于本地存储 这里介绍的是基于本地存储的热迁移 动态块迁移版本要求 qemu版本要求 大于或等于...

    terraform-libvirt-vm:KVMLibvirt虚拟机的Terraform模块

    该模块将创建一个KVM虚拟机,使用Cloud Init对其进行配置并测试ssh连接。 该模块正在使用 Terraform提供程序。 本模块提供的内容 创建一个或多个虚拟机 每个域一个网卡,使用网桥接口连接到网络 使用DHCP或静态配置...

    ansible-role-libvirt-host:该角色将主机配置为LibvirtKVM虚拟机管理程序。 它还可以在主机上配置存储池和网络

    该角色将主机配置为Libvirt / KVM虚拟机管理程序。 它还可以在主机上配置存储池和网络。 要求 主机应启用虚拟化技术(VT)。 角色变量 libvirt_host_pools是要定义和启动的池的列表。 每个项目应为包含以下项目的...

    KVM虚拟化(一)——KVM虚拟机的介绍与简单使用

    KVM(Kernel-based Virtual Machine)它由 Quramnet 开发,该公司于 2008年被 Red Hat 收购; 自Linux 2.6.20后整合到内核,该内核模块使得 Linux 变成了一个 Hypervisor层; 它依托于CPU虚拟化指令集,性能、安全性...

    Linux从入门到放弃 kvm虚拟机

    [root@kvm ~]# systemctl stop NetworkManager.service ...[root@kvm ~]# yum install libvirt virt-install qemu-kvm -y [root@kvm ~]# systemctl start libvirtd [root@kvm ~]# systemctl status libvirtd

    LibVirtKvm-scripts:LibvirtKVM脚本-libvirtKVM虚拟机的在线正向增量备份

    LibVirtKvm脚本地位在主分支上在开发部门fi-backup-Libvirt / KVM VM的在线正向增量备份fi-backup可用于对libvirt / KVM虚拟机进行脱机或在线正向增量备份。 它适用于具有多个磁盘的VM,但前提是磁盘映像为qcow2格式...

    kvm创建 kvm管理命令 管理工具

    kvm创建 kvm管理命令 管理工具 强制关闭虚拟机: virsh destroy vmhost 创建快照:virsh snapshot-create-as xuegod63-kvm2 httpd (httpd是快照名字) 查看快照位置:ll -h /var/lib/libvirt/qemu/snapshot/xuegod63...

    Foundations of Libvirt Developments.pdf

    了解Libvirt开发的基本概念,并了解如何与Linux虚拟化环境进行接口,如QEMU/KVM、Xen...虽然libvirt有支持多种语言的API,但是Libvirt开发的基础只关注Python,以及如何使用API控制QEMU/KVM系统下的虚拟机。还有更多。

    libvirt_vmcfg:用于libvirt虚拟机配置的XML构建器

    libvirt_vmcfg是用于生成XML VM规范以供libvirt使用的库。 它处于Alpha状态,但欢迎拉取请求。 由于我还有其他优先事项,目前的文档记录很差。 有时间时,我将创建更好的文档。 例子 域生成器 from libvirt_vmcfg...

    在虚拟机上运行MacOSXOSX-KVM.zip

    i5-6500 CPU 上运行 Ubuntu 15.10在 i5-6500 CPU 上运行 Fedora 24与 QEMU 2.4.1 和 QEMU 2.5 进行测试安装:按以下 virsh 方法参阅 boot.sh 文件:virsh --connect qemu:///system define macOS-libvirt....

Global site tag (gtag.js) - Google Analytics