美文网首页
KVM虚拟机核心组件介绍-virt-manager

KVM虚拟机核心组件介绍-virt-manager

作者: 我是李小胖 | 来源:发表于2021-09-07 14:08 被阅读0次

    virt-manager和kvm虚拟机热迁移(共享的网络文件系统)

    • 冷迁移kvm虚拟机:配置文件,磁盘文件
    • 热迁移kvm虚拟机:配置文件,nfs共享存储

    0x1 热迁移各主机实验环境(桥接网卡)

    1.1kvm虚拟机热迁移大体步骤规划

    • 两边的环境(桥接网卡)
    • 实现共享存储(NFS)
    • 虚拟机桥接网络
    • 在线热迁移

    0x2 实现共享存储(NFS)

    #安装NFS
    yum install -y nfs-utils rpcbind
    #修改配置文件允许10.0.0.0/24网段
    vim /etc/exports /data  10.0.0.0/24(rw,async,no_root_squash,no_all_squash)
    #启动服务
    systemctl start rpcbind nfs
    #KVM01和KVM02挂在NFS
    mount -t nfs 10.0.0.31:/data /data
    

    0x3 VMWare虚拟机桥接网络

    0x4 在线热迁移

    wget http://172.20.8.8/kvm_test/web04.qcow2
    virt-install --virt-type kvm --os-type=linux --os-variant rhel7 --name web04 --memory 1024,maxmemory=2048 --vcpus 1,maxvcpus=10 --disk /vm_data/disk/web04.qcow2 --boot hd --network bridge=br0 --graphics vnc,listen=0.0.0.0 --noautoconsole
    
    #临时迁移
    virsh migrate --live --verbose web04 qemu+ssh://10.0.0.100/system --unsafe 
    #永久迁移
    virsh migrate --live --verbose web04 qemu+ssh://10.0.0.100/system --unsafe --persistent --undefinesource
    #配置网卡
    echo 'TYPE="Ethernet"
    BOOTPROTO="none"
    NAME="eth1"
    DEVICE="eth1"
    ONBOOT="yes"
    IPADDR="10.0.0.101"
    NETMASK="255.255.255.0"
    GATEWAY="10.0.0.254"
    DNS1="223.5.5.5"'  >/etc/sysconfig/network-scripts/ifcfg-eth1
    

    相关文章

      网友评论

          本文标题:KVM虚拟机核心组件介绍-virt-manager

          本文链接:https://www.haomeiwen.com/subject/kixtactx.html