在工作当中如果虚拟机的容量不够使用 如何添加呢?

CPU添加

cpu添加有两种方式:

1 创建虚拟机的时候可以添加

# virt-install --help | grep cpu
--vcpus=VCPUS Number of vcpus to configure for your guest. Ex:
--vcpus
--vcpus ,maxcpus=
--vcpus sockets=,cores=,threads=

安装的时候手动可以添加

--vcpus 5:添加5个虚拟vcpu 当前

--vcpus 5,maxcpus=10:当前CPU为5 最大CPU设置为10

2 创建好的 可以编辑文件更改

更改前内容

<domain type='kvm'>
<name>CentOS-6.5-x86_64</name>
<uuid>e9258e70---2f2f-cb713c74e2fc</uuid>
<memory unit='KiB'></memory>
<currentMemory unit='KiB'></currentMemory>
<vcpu placement='static'></vcpu>

更改后的内容

# virsh list --all
Id Name State
----------------------------------------------------
CentOS-6.5-x86_64 running # virsh edit CentOS-6.5-x86_64
Domain CentOS-6.5-x86_64 XML configuration edited.
<domain type='kvm'>
<name>CentOS-6.5-x86_64</name>
<uuid>e9258e70---2f2f-cb713c74e2fc</uuid>
<memory unit='KiB'></memory>
<currentMemory unit='KiB'></currentMemory>
<vcpu placement='auto' current=""></vcpu>
更改为当前1vcpu 最大可获得4vcpu

更改完之后需要重启虚拟机

CentOS7 支持热添加

#virsh setvcpus name  --live

热添加总数不能超过最大CPU

内存添加

# virsh edit CentOS-6.5-x86_64

更改前

<domain type='kvm'>
<name>CentOS-6.5-x86_64</name>
<uuid>e9258e70---2f2f-cb713c74e2fc</uuid>
<memory unit='KiB'></memory>
<currentMemory unit='KiB'></currentMemory>
<vcpu placement='auto' current=''></vcpu>

更改后

<domain type='kvm'>
<name>CentOS-6.5-x86_64</name>
<uuid>e9258e70---2f2f-cb713c74e2fc</uuid>
<memory unit='KiB'></memory>
<currentMemory unit='KiB'></currentMemory>
<vcpu placement='auto' current=''></vcpu>

更改为最大4G  重启虚拟机

查看内存

# virsh qemu-monitor-command CentOS-6.5-x86_64 --hmp --cmd info balloon
balloon: actual=

内存热添加

# virsh qemu-monitor-command CentOS-6.5-x86_64 --hmp --cmd  balloon 

KVM 基本硬件容量扩容的更多相关文章

  1. CentOS下KVM增加磁盘/磁盘扩容/在线扩容

    一.磁盘镜像操作(适用于raw和qcow2格式) 1.创建镜像 qemu-img create -f qcow2(格式) /kvm/centos1_1.qcow2(路径) 5G(容量) 2.修改镜像容 ...

  2. kvm增加磁盘容量

    一.qcow2格式 查看镜像文件实际占用空间 ls -alh t.qcow2 加容量(只能加不能减) qemu-img resize t.qcow2 +1G 查看qcow2信息 qemu-img in ...

  3. lvm 通过扩容本身磁盘容量扩容

    场景:sdb之前是3G容量,现在扩容了sdb的容量到8G.现在把新扩容的5G容量扩展到现有的逻辑卷中 [root@localhost ~]# pvresize /dev/sdb  Physical v ...

  4. KVM之XFS磁盘扩容

    1.前言 根据目前我们使用的需求,以前规划的100G磁盘空间不够,这里将演示XFS文件系统的扩容,因为我使用的是KVM所以也会演示KVM的扩容方式. 2.KVM磁盘扩容 扩容前一定要先备份,或者做快照 ...

  5. 逻辑卷管理LVM 扩容LV容量实例(一)

    实验环境: 一台Linux 服务器添加两块硬盘,一块硬盘容量30G,另一块硬盘容量50G,采用VMware Workstation虚拟机进行模拟实验. 30G硬盘先分成一个分区,分区大小为25G,再创 ...

  6. 1 云计算系列之云计算概述和KVM虚拟化简介

    为什么会出现云之传统数据中学面临的问题 物理服务器的利用率非常低,浪费资源,且资源分配不合理,比如一台服务器CPU使用率不到40%,或者某个应用需要的硬件配置低但是服务器硬件配置高等等. 云计算概念 ...

  7. KVM的虚拟化研究及应用

    引言 虚拟化技术是IBM在20世纪70年代首先应用在IBM/370大型机上,这项技术极大地提高了大型机资源利用率.随着软硬件技术的迅速发展,这项属于大型机及专利的技术开始在普通X86计算机上应用并成为 ...

  8. 管理KVM虚拟机(二)

    管理KVM虚拟机 工具:libvirt 官网:http://libvirt.org/ 介绍:Libvirt 库是一种实现 Linux 虚拟化功能的 Linux® API,它支持各种虚拟机监控程序,包括 ...

  9. VM 操作系统实例化(基于 KVM 的虚拟化研究及应用--崔泽永(2011))的论文笔记

    一.VM操作系统实例化 1.建立虚拟磁盘镜像 虚拟磁盘镜像在逻辑上是提供给虚拟机使用的硬盘, 在物理上可以是 L inux系 统内一普通镜像文件, 也可以是真实的物理磁盘或分区. 本方案设计中将虚拟机 ...

随机推荐

  1. 第九十节,html5+css3pc端固定布局,底部区域,说明区域,版权区域

    html5+css3pc端固定布局,底部区域,说明区域,版权区域 完成: HTML代码: <!--尾部--> <footer class="wei-bu"> ...

  2. ZOJ Martian Addition

    Description In the 22nd Century, scientists have discovered intelligent residents live on the Mars. ...

  3. 更改自身web项目的图标(默认为tomcat的小喵咪)

    在页面<head>标签中加入 <link rel="shortcut icon" href="img/11.png" type="i ...

  4. Leetcode 073 Set Matrix Zeroes

    Given a m x n matrix, if an element is 0, set its entire row and column to 0. Do it in place. click ...

  5. LeetCode OJ 122. Best Time to Buy and Sell Stock II

    Say you have an array for which the ith element is the price of a given stock on day i. Design an al ...

  6. 计算机安装了IE8一半退出重启时,桌面只显示背景

    记得我在一家公司实习网管的时候,我遇到过一个这样的情况:那时候公司就我一个网管(原来的那个老员工走了才临时要了我),公司有台台式,上面装了公司的ERP还有一系列的软件.因为那个ERP限制了机器,用另外 ...

  7. wuzhi 五指 基本知识

    参数:m 模块 在于  /coreframe/app/模块文件夹 |默认 content f  php文件 控制器  在于/coreframe/app/模块 /文件.php | 默认 index v ...

  8. 第三次冲刺spring会议(第六次会议)

    [例会时间]2014/5/25 21:15 [例会地点]9#446 [例会形式]轮流发言 [例会主持]马翔 [例会记录]兰梦 小组成员:兰梦 ,马翔,李金吉,赵天,胡佳奇

  9. LeadTools答题卡识别方案

    /// <summary> /// 批改操作 /// </summary> public AnswerCard DoCorrect(Stream AnserCardFile) ...

  10. CentOS 7 多网卡绑定

    根据官方文档Red_Hat_Enterprise_Linux-7-Networking_Guide-en-US用nmcli做起来还是相当容易的.下面把俺的步骤贴下. 1.查看目前网卡的名称和状态.#n ...