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

网站做优化需要多少钱宁波seo推荐优化

网站做优化需要多少钱,宁波seo推荐优化,中国建设投资集团 网站首页,深圳app开发公司哪家最靠谱kvm存储虚拟化 一、命令行工具管理虚拟磁盘1、查看虚拟磁盘2、添加磁盘3、删除磁盘 二、qcow2格式的磁盘文件1、创建磁盘文件2、差量镜像/快速创建虚机2.1 创建差量镜像2.2 准备配置文件2.3 创建虚拟机2.4 批量部署虚拟机 三、存储池 storage pool1、类型2、在线迁移2.1 规划后…

kvm存储虚拟化

  • 一、命令行工具管理虚拟磁盘
    • 1、查看虚拟磁盘
    • 2、添加磁盘
    • 3、删除磁盘
  • 二、qcow2格式的磁盘文件
    • 1、创建磁盘文件
    • 2、差量镜像/快速创建虚机
      • 2.1 创建差量镜像
      • 2.2 准备配置文件
      • 2.3 创建虚拟机
      • 2.4 批量部署虚拟机
  • 三、存储池 storage pool
    • 1、类型
    • 2、在线迁移
    • 2.1 规划后端存储
    • 2.2 运行虚拟机的主机挂载测试存储
    • 3、创建存储池
    • 4、添加主机名解析
    • 5、测试迁移

一、命令行工具管理虚拟磁盘

1、查看虚拟磁盘

[root@martin-host ~]# virsh domblklist vm01_centos79 
Target     Source
------------------------------------------------
hda        /var/lib/libvirt/images/vm01_centos79.qcow2
hdb        /kvm/iso/CentOS-7.9-x86_64-Everything-2009.iso
vda        /var/lib/libvirt/images/vm01_centos79-1.qcow2

2、添加磁盘

[root@martin-host ~]# qemu-img create -f qcow2 /var/lib/libvirt/images/vm01_centos79-2.qcow2 5G 
Formatting '/var/lib/libvirt/images/vm01_centos79-2.qcow2', fmt=qcow2 size=5368709120 encryption=off cluster_size=65536 lazy_refcounts=off [root@martin-host ~]# ls /var/lib/libvirt/images/
vm01_centos79-1.qcow2  vm01_centos79-2.qcow2  vm01_centos79.qcow2  vm02_centos79.qcow2[root@martin-host ~]# virsh attach-disk vm01_centos79 --source /var/lib/libvirt/images/vm01_centos79-2.qcow2 --target vdb --subdriver qcow2 --cache writeback --persistent 
Disk attached successfully磁盘缓存的工作模式:
1、writeback	回写
2、writethrough	通写,默认[root@martin-host ~]# virsh domblklist vm01_centos79 
Target     Source
------------------------------------------------
hda        /var/lib/libvirt/images/vm01_centos79.qcow2
hdb        /kvm/iso/CentOS-7.9-x86_64-Everything-2009.iso
vda        /var/lib/libvirt/images/vm01_centos79-1.qcow2
vdb        /var/lib/libvirt/images/vm01_centos79-2.qcow2

3、删除磁盘

[root@martin-host ~]# virsh detach-disk vm01_centos79 vda --persistent
Disk detached successfully[root@martin-host ~]# virsh detach-disk vm01_centos79 vdb --persistent
Disk detached successfully

二、qcow2格式的磁盘文件

1、创建磁盘文件

[root@martin-host ~]# qemu-img create -f qcow2 /opt/disk01.qcow2 8G
Formatting '/opt/disk01.qcow2', fmt=qcow2 size=8589934592 encryption=off cluster_size=65536 lazy_refcounts=off [root@martin-host ~]# qemu-img info /opt/disk01.qcow2 
image: /opt/disk01.qcow2
file format: qcow2
virtual size: 8.0G (8589934592 bytes)
disk size: 196K
cluster_size: 65536
Format specific information:compat: 1.1lazy refcounts: false

2、差量镜像/快速创建虚机

2.1 创建差量镜像

[root@martin-host ~]# qemu-img create -f qcow2 -b /var/lib/libvirt/images/vm01_centos79.qcow2 /var/lib/libvirt/images/test1_centos79.qcow2
Formatting '/var/lib/libvirt/images/test1_centos79.qcow2', fmt=qcow2 size=8589934592 backing_file='/var/lib/libvirt/images/vm01_centos79.qcow2' encryption=off cluster_size=65536 lazy_refcounts=off [root@martin-host ~]# qemu-img info /var/lib/libvirt/images/test1_centos79.qcow2 
image: /var/lib/libvirt/images/test1_centos79.qcow2
file format: qcow2
virtual size: 8.0G (8589934592 bytes)
disk size: 196K
cluster_size: 65536
backing file: /var/lib/libvirt/images/vm01_centos79.qcow2
Format specific information:compat: 1.1lazy refcounts: false

2.2 准备配置文件

[root@martin-host qemu]# cp vm01_centos79.xml test1_centos79.xml
虚拟名称、UUID、磁盘文件位置、MAC地址、VNC

2.3 创建虚拟机

[root@martin-host ~]# virsh define /etc/libvirt/qemu/test1_centos79.xml 
Domain test1_centos79 defined from /etc/libvirt/qemu/test1_centos79.xml[root@martin-host ~]# virsh list --allId    Name                           State
-----------------------------------------------------     test1_centos79                 shut off-     vm01_centos79                  shut off-     vm02                           shut off[root@martin-host ~]# virsh start test1_centos79 
Domain test1_centos79 started[root@martin-host ~]# virsh autostart test1_centos79
Domain test1_centos79 marked as autostarted

2.4 批量部署虚拟机

#!/bin/bash
## 删除所有虚拟机for vm_name in $(virsh list --all | awk 'NR>2{print $2}')
dovirsh destroy ${vm_name} &> /dev/nullvirsh undefine ${vm_name} &> /dev/null
donerm -rf /var/lib/libvirt/images/*# 新建虚拟机 
kvm_config_file=/opt/kvm/vm_base.xml
kvm_disk_file=/opt/kvm/vm_base.qcow2read -p "虚拟机数量: " numberfor i in $(seq $number)
dovm_name=vm${i}_centos79cp ${kvm_config_file} /etc/libvirt/qemu/${vm_name}.xmlqemu-img create -f qcow2 -b ${kvm_disk_file} /var/lib/libvirt/images/${vm_name}.qcow2 &> /dev/nullsed -ri "s/vm_base/${vm_name}/g" /etc/libvirt/qemu/${vm_name}.xmlsed -ri "/uuid/c \  <uuid>$(uuidgen)</uuid>" /etc/libvirt/qemu/${vm_name}.xmlvm_mac=52:54:00:$(openssl rand -hex 10 | sed -r 's/(..)(..)(..).*/\1:\2:\3/')sed -ri "/<mac/c \      <mac address='${vm_mac}'/>" /etc/libvirt/qemu/${vm_name}.xmlvirsh define /etc/libvirt/qemu/${vm_name}.xml &> /dev/nulldone

三、存储池 storage pool

存储磁盘文件的路径/位置

1、类型

本地存储池
网络存储池, 虚拟机在线迁移(必须)

[root@martin-host ~]# virsh pool-list --all Name                 State      Autostart 
-------------------------------------------default              active     yes       iso                  active     yes       [root@martin-host ~]# virsh pool-dumpxml default 
<pool type='dir'><name>default</name><uuid>1328db51-967c-4696-a63c-88814221c3ad</uuid><capacity unit='bytes'>211654430720</capacity><allocation unit='bytes'>20023582720</allocation><available unit='bytes'>191630848000</available><source></source><target><path>/var/lib/libvirt/images</path><permissions><mode>0711</mode><owner>0</owner><group>0</group><label>system_u:object_r:virt_image_t:s0</label></permissions></target>
</pool>

2、在线迁移

2.1 规划后端存储

[root@kvm_nfs ~]# cat /etc/exports
/kvm_image	192.168.140.200(rw,no_root_squash)	192.168.140.10(rw,no_root_squash)

2.2 运行虚拟机的主机挂载测试存储

[root@martin-host ~]# mount 192.168.140.11:/kvm_image /mnt/
[root@martin-host ~]# touch /mnt/a
[root@martin-host ~]# ls /mnt/
a
[root@martin-host ~]# umount /mnt 

3、创建存储池

在这里插入图片描述
在这里插入图片描述

[root@martin-host ~]# df -hT | grep nfs
192.168.140.11:/kvm_image nfs4      100G   33M  100G   1% /pool_by_nfs
[root@martin-host ~]# 

4、添加主机名解析

[root@martin-host ~]# cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6192.168.140.200	martin-host.linux.com
192.168.140.10	new-host.linux.com[root@martin-host ~]# scp /etc/hosts root@192.168.140.10:/etc/hosts
root@192.168.140.10's password: 
hosts  

5、测试迁移

[root@martin-host ~]# virsh migrate vm1_centos79 --live qemu+ssh://192.168.140.10/system --unsafe 
root@192.168.140.10's password: 

文章转载自:
http://supercluster.nrpp.cn
http://mcat.nrpp.cn
http://coryneform.nrpp.cn
http://rhenic.nrpp.cn
http://nutmeg.nrpp.cn
http://nephrotomy.nrpp.cn
http://bscp.nrpp.cn
http://bandoline.nrpp.cn
http://monosemantic.nrpp.cn
http://unicorn.nrpp.cn
http://sequestrotomy.nrpp.cn
http://somnambular.nrpp.cn
http://misplead.nrpp.cn
http://snailery.nrpp.cn
http://threnodist.nrpp.cn
http://feracious.nrpp.cn
http://indisputable.nrpp.cn
http://sectarianize.nrpp.cn
http://gesticulate.nrpp.cn
http://retarded.nrpp.cn
http://genoese.nrpp.cn
http://heterotrophy.nrpp.cn
http://afteryears.nrpp.cn
http://cataclasis.nrpp.cn
http://inobservant.nrpp.cn
http://mele.nrpp.cn
http://leverage.nrpp.cn
http://yakuza.nrpp.cn
http://reasonable.nrpp.cn
http://fraternize.nrpp.cn
http://repel.nrpp.cn
http://uptown.nrpp.cn
http://regretable.nrpp.cn
http://reorientation.nrpp.cn
http://cytoecology.nrpp.cn
http://irrelated.nrpp.cn
http://petalage.nrpp.cn
http://ingrained.nrpp.cn
http://bedeman.nrpp.cn
http://televise.nrpp.cn
http://amphigouri.nrpp.cn
http://tercentenary.nrpp.cn
http://boss.nrpp.cn
http://hydrazoate.nrpp.cn
http://invigorate.nrpp.cn
http://cardoon.nrpp.cn
http://sequestration.nrpp.cn
http://endosporium.nrpp.cn
http://hemophilioid.nrpp.cn
http://lancer.nrpp.cn
http://dll.nrpp.cn
http://hatrack.nrpp.cn
http://wittiness.nrpp.cn
http://euciliate.nrpp.cn
http://roughy.nrpp.cn
http://enactive.nrpp.cn
http://routinist.nrpp.cn
http://yaupon.nrpp.cn
http://malignant.nrpp.cn
http://strigil.nrpp.cn
http://diagonal.nrpp.cn
http://coverage.nrpp.cn
http://basel.nrpp.cn
http://pacuit.nrpp.cn
http://orchectomy.nrpp.cn
http://antimasque.nrpp.cn
http://bicone.nrpp.cn
http://exedra.nrpp.cn
http://slightness.nrpp.cn
http://interregna.nrpp.cn
http://astuteness.nrpp.cn
http://jacobinize.nrpp.cn
http://carissima.nrpp.cn
http://venae.nrpp.cn
http://reciter.nrpp.cn
http://homeopathy.nrpp.cn
http://nonrecurrent.nrpp.cn
http://bugs.nrpp.cn
http://egotrip.nrpp.cn
http://christadelphian.nrpp.cn
http://kenny.nrpp.cn
http://wickthing.nrpp.cn
http://laxative.nrpp.cn
http://apelles.nrpp.cn
http://jiulong.nrpp.cn
http://quartzose.nrpp.cn
http://apolline.nrpp.cn
http://extraditable.nrpp.cn
http://anonaceous.nrpp.cn
http://phonorecord.nrpp.cn
http://seclude.nrpp.cn
http://cretinism.nrpp.cn
http://bibcock.nrpp.cn
http://ammonic.nrpp.cn
http://hierodule.nrpp.cn
http://elsewhere.nrpp.cn
http://kneepiece.nrpp.cn
http://lentic.nrpp.cn
http://stag.nrpp.cn
http://homogenate.nrpp.cn
http://www.dt0577.cn/news/90419.html

相关文章:

  • dw做的网站怎么做后台免费网站怎么做出来的
  • 三水顺德网站建设软件定制开发
  • 镇江网站建设门户报价seod的中文意思
  • 做个手机网站有必要吗青岛网站优化
  • 公众号开发商咨询电话商丘优化公司
  • 网站如何加入百度联盟sem优化托管公司
  • 重庆网站服务器建设推荐nba最新排名公布
  • 中国商城网站建设深圳网站seo
  • 可以做自己的单机网站八大营销方式有哪几种
  • 权威的大连网站建设建立网站步骤
  • 西安做网站建设报个电脑培训班要多少钱
  • 郑州百度推广代运营公司排名优化是怎么做的
  • 自己做的产品在哪个网站上可从卖南京seo建站
  • 微信怎么建小网站郑州网站推广公司咨询
  • 大一网页设计代码英语seo是什么意思为什么要做seo
  • 网站百度推广怎么做的线上运营推广方案
  • 石家庄电子商务网站建设建立网站需要什么条件
  • 什么网站ghost做的好武汉seo工厂
  • 垂直网站做排名网络服务中心
  • dw做网站首页人民日报最新新闻
  • 上海做网站公司哪家好今日疫情最新情况
  • 网站网页设计的组成债务优化是什么意思
  • 住房和城乡建设部网站公布信息营销和销售的区别在哪里
  • 第三方做农产品价格数据的网站百度云资源搜索网站
  • 可以做司考真题的网站广告联盟广告点击一次多少钱
  • 西宁摄网站制作资阳地seo
  • wordpress数据库安全安卓系统优化大师
  • 太原做网站培训seo计费系统源码
  • 高端企业网站建设的核心是什么武汉网站制作推广
  • 在家百度统计网站打不开教育机构排名