• kvm克隆


    Kvm克隆:

     

    克隆前需要关闭kvm虚拟机

     

    [root@super67 ~]# virt-clone -o ubuntu16 -n ubuntu16-1 -f /var/lib/libvirt/images/ubuntu16-1.img

    Cloning unbuntu16.raw                                                                                                         |  107 B     00:00    

    Clone 'ubuntu16-1' created successfully.

     

    查看克隆出来的配置文件:

    [root@super67 ~]# ll /etc/libvirt/qemu/

    total 20

    drwxr-xr-x 2 root root 4096 Sep  4 10:31 autostart

    drwx------ 3 root root 4096 Sep  4 13:43 networks

    -rw------- 1 root root 2297 Sep  4 13:58 ubuntu16-1.xml

    -rw------- 1 root root 2290 Sep  4 13:13 ubuntu16.xml

    -rw------- 1 root root 2574 Sep  4 10:32 www.linux1.cn.xml

     

     

    对比和原来的区别:

    [root@super67 ~]# cd !$

    cd /etc/libvirt/qemu/

    [root@super67 qemu]# diff ubuntu16.xml ubuntu16-1.xml

    4c4

    <   virsh edit ubuntu16

    ---

    >   virsh edit ubuntu16-1

    9,10c9,10

    <   <name>ubuntu16</name>

    <   <uuid>729109f3-6bcc-2f44-b1d3-4f9f6bface83</uuid>

    ---

    >   <name>ubuntu16-1</name>

    >   <uuid>2402c258-0631-1864-a958-f445a95a3f29</uuid>

    31c31

    <       <source file='/var/lib/libvirt/disk/unbuntu16.raw'/>

    ---

    >       <source file='/var/lib/libvirt/images/ubuntu16-1.img'/>

    48c48

    <       <mac address='52:54:00:b0:48:17'/>

    ---

    • <mac address='52:54:00:1b:4d:62'/>

     

     

    如果克隆出现的虚拟机需要连接网络:

    需要进入克隆出来的kvm虚拟机的系统中:

    删除/etc/udev/…70-net……文件

    修改网卡ifcfg-eth0配置

    重启kvm虚拟机。

  • 相关阅读:
    深入理解Java Proxy机制
    StringBuilder与StringBuffer的区别
    反射
    list和set区别
    spring总结
    Hibernate与 MyBatis的比较
    手机拍照或选择照片上传html5代码
    JSP两种跳转
    离散化
    圆方树
  • 原文地址:https://www.cnblogs.com/fanxuanhui-linux/p/5839264.html
Copyright © 2020-2023  润新知