当前位置: 首页 > news >正文

网站开发 超速云网站优化目录

网站开发 超速云,网站优化目录,企业宣传文案,邯郸市属于哪个省Linux下 如何通过命令行使用现有的镜像创建、启动kvm虚拟机 这里假定已经创建好了相应的镜像#xff1a; eg#xff1a;我这里制作的镜像名称为zu1-centos7.img # lszu1-centos7.img 1、拷贝这个镜像到某一个目录 cp zu1-centos7.img /data2/ 2、编写镜像的配置文件#x…Linux下 如何通过命令行使用现有的镜像创建、启动kvm虚拟机 这里假定已经创建好了相应的镜像 eg我这里制作的镜像名称为zu1-centos7.img # lszu1-centos7.img 1、拷贝这个镜像到某一个目录 cp zu1-centos7.img /data2/ 2、编写镜像的配置文件当然一般情况是从其他镜像的配置文件拷贝一份重新命名在修改 # cd /etc/libvirt/qemu 进入到镜像配置文件目录 # cp test2.xml test3.xml test2.xml是其他镜像存在的配置文件test3.xml是当前准备启动的镜像的配置文件 test2.xml配置文件大体如下 !-- WARNING: THIS IS AN AUTO-GENERATED FILE. CHANGES TO IT ARE LIKELY TO BE OVERWRITTEN AND LOST. Changes to this xml configuration should be made using:virsh edit test2 or other application using the libvirt API. --domain typekvmnametest2/name ---虚拟机名字记得修改随便起什么名字都行只要不跟其他虚拟机名字一样就行uuid92047c95-c5b8-4e4d-916c-fb2218ca055f/uuid --uuid 记得修改一般来说把最好的四位数字重新修改一下例如我把最后四位改成0001具体效果看下个test3.xml文件memory unitKiB10485760/memory ---当前虚拟机使用内存看自己情况是否需要修改currentMemory unitKiB10485760/currentMemory ---当前虚拟机可以使用的最大内存使用内存不得超过这个内存当使用内存不足的时候可以在虚拟机里面动态调整内存。vcpu placementstatic1/vcpuostype archx86_64 machinerhel6.6.0hvm/type ---架构一般不用修改boot devhd//osfeaturesacpi/apic/pae//featuresclock offsetutc/on_poweroffdestroy/on_poweroffon_rebootrestart/on_rebooton_crashrestart/on_crashdevicesemulator/usr/libexec/qemu-kvm/emulatordisk typefile devicediskdriver nameqemu typeqcow2 cachenone/ ---driver类型需要跟镜像的文件格式一致。以前老版本默认是raw类型现在默认是qcow2类型。查看镜像的文件格式在该配置文件的下面source file/data1/iso/zu1-centos7.img/ --- 镜像文件路径target devvda busvirtio/ address typepci domain0x0000 bus0x00 slot0x05 function0x0//diskdisk typeblock devicecdromdriver nameqemu typeqcow2/target devhdc buside/readonly/address typedrive controller0 bus1 target0 unit0//diskcontroller typeide index0address typepci domain0x0000 bus0x00 slot0x01 function0x1//controllercontroller typeusb index0 modelpiix3-uhciaddress typepci domain0x0000 bus0x00 slot0x01 function0x2//controllercontroller typepci index0 modelpci-root/interface typebridgemac address52:54:00:5a:07:de/source bridgebr0/model typevirtio/address typepci domain0x0000 bus0x00 slot0x03 function0x0/ ---这里的slot号记得修改 把最后两位改成其他的就行但不要跟其他的虚拟机配置的值一样同时这个值不超过 0x0f/interfaceserial typeptytarget typeisa-serial port0model nameisa-serial//target/serialconsole typeptytarget typeserial port0//consoleinput typetablet bususbaddress typeusb bus0 port1//inputinput typemouse busps2/input typekeyboard busps2/memballoon modelvirtioaddress typepci domain0x0000 bus0x00 slot0x06 function0x0//memballoon/devices /domain 3、查看镜像的driver类型 # qemu-img info /data1/zu1-centos7.img image: /data1/virtcentos/pool/zu1-centos7.img file format: qcow2 ----这里就是镜像的文件格式 virtual size: 20G (21474836480 bytes) disk size: 18G cluster_size: 65536 Format specific information:compat: 1.1lazy refcounts: true 4、修改test3.xml文件如下 !-- WARNING: THIS IS AN AUTO-GENERATED FILE. CHANGES TO IT ARE LIKELY TO BE OVERWRITTEN AND LOST. Changes to this xml configuration should be made using:virsh edit test2 or other application using the libvirt API. --domain typekvmnameyjt/name ---这里改成了yjtuuid92047c95-c5b8-4e4d-916c-fb2218ca0001/uuidmemory unitKiB10485760/memorycurrentMemory unitKiB10485760/currentMemoryvcpu placementstatic1/vcpuostype archx86_64 machinerhel6.6.0hvm/typeboot devhd//osfeaturesacpi/apic/pae//featuresclock offsetutc/on_poweroffdestroy/on_poweroffon_rebootrestart/on_rebooton_crashrestart/on_crashdevicesemulator/usr/libexec/qemu-kvm/emulatordisk typefile devicediskdriver nameqemu typeqcow2 cachenone/source file/data2/zu1-centos7.img/ ---这里修改了镜像的路径target devvda busvirtio/address typepci domain0x0000 bus0x00 slot0x05 function0x0//diskdisk typeblock devicecdromdriver nameqemu typeqcow2/target devhdc buside/readonly/address typedrive controller0 bus1 target0 unit0//diskcontroller typeide index0address typepci domain0x0000 bus0x00 slot0x01 function0x1//controllercontroller typeusb index0 modelpiix3-uhciaddress typepci domain0x0000 bus0x00 slot0x01 function0x2//controllercontroller typepci index0 modelpci-root/interface typebridgemac address52:54:00:5a:07:de/source bridgebr0/model typevirtio/address typepci domain0x0000 bus0x00 slot0x10 function0x0/ 这里改成了0x10注意,该值不得超过0x0f/interfaceserial typeptytarget typeisa-serial port0model nameisa-serial//target/serialconsole typeptytarget typeserial port0//consoleinput typetablet bususbaddress typeusb bus0 port1//inputinput typemouse busps2/input typekeyboard busps2/memballoon modelvirtioaddress typepci domain0x0000 bus0x00 slot0x06 function0x0//memballoon/devices /domain 5、定义虚拟机 # virsh define test3.xml ---定义虚拟机跟上对应的文件即可 6、启动虚拟机 virsh start yjt ---yjt这个名字在配置文件定义的也就是虚拟机的名字。 到这里就ok了。 如果虚拟机不要用了可以使用如下方法销毁 7、停止虚拟机 # virsh shutdown yjt ---正常停止 # virsh destroy yjt ---强制停止 8、取消虚拟机的定义也就是删除 # virsh undefine yjt ---默认会删除/etc/libvirt/qemu下的test3.xml文件  转载于:https://www.cnblogs.com/yjt1993/p/10833641.html
http://www.zqtcl.cn/news/992632/

相关文章:

  • 溧阳 招网站开发wordpress 占内存
  • 网站seo 工具做网站建设公司排名
  • 丹阳网站建设企业建设网站管理制度
  • 怎样审请网站集成装修全屋定制
  • 好看响应式网站模板下载可以访问的国外网站
  • 做电脑网站宽度网站建立安全连接失败
  • 西安网站设计哪家公司好my12777域名查询
  • 西宁网站建设排名网站设计对网站建设有哪些意义?
  • 北京平台网站建设价位怎样做网站卖网站
  • 网站建设与维护试题a卷建设银行官方网站买五粮液酒
  • 安装网站源码做文艺文创产品的网站
  • 软件公司网站设计与制作电子商务成功网站的案例
  • 购物车功能网站怎么做的建设众筹类网站
  • 哪些网站做的美爱站工具网
  • 对网站开发的理解源码资源网
  • 有哪些做兼职的网站网站建设的项目计划书
  • 如何做行业网站江苏城乡建设部网站首页
  • 淘客网站怎么做 知乎wordpress 删除插件
  • 深圳市住房和建设局人事调整公司网站seo怎么做
  • 小型影视网站源码好看的个人博客
  • 哈密建设厅网站西安培训机构
  • 网站建设公众号小程序开发密云网站开发
  • 南宁网站开发制作网站数据库分离怎么做
  • 不能打开建设银行网站怎么办自己做网站要会什么软件下载
  • 微软网站怎么做的diy个性定制
  • 洛阳做网站的公司宣传品牌网站建设
  • 公司网站开发招标书电子商务网站系统
  • 哪个旅游网站做的最好营销策划方案范文免费下载
  • 德州哪家网站优化公司专业单页网站seo如何优化
  • 南昌汉邦网站建设城建局