Vcenter Vsphere centos 7 服务器扩容实战

VMware Knowledge Base参考链接 VMware Knowledge Base

1. 删除之前的snapshots 在扩容过程中都不能有snapshots 因此如有需要请提前备份

Actions -> Snapshots -> Manage Snapshots -> DELETE ALL

2. 服务器关机

关机命令

  1. halt:立刻关机
  2. poweroff:立刻关机
  3. shutdown -h now:立刻关机(root用户使用)
  4. shutdown -h 10:10分钟后自动关机

3. 增加服务器硬盘容量

关机后cpu和memory从灰色变为可修改

如果 硬盘显示灰色说明有snapshots 未删除

4. 更改后 重启 服务器

5. 打开终端 用ssh 命令 登录 root 用户

6.执行 df -h 查看磁盘空间

7. sudo fdisk -l 

8. sudo fdisk /dev/sda

   

  • Type n to create a new partition.
  • Choose the primary partition type.
  • Choose the default partition size to use the whole disk.
  • Type t to change the partition type.
  • Choose the partition number of the new partition.
  • Type 8e to set the partition type to Linux LVM.
  • Type p to print the partition table and make sure it looks correct.
  • Type w to save the changes and exit.

9.  sudo pvcreate /dev/sdX1

/dev/sdX1 with the name of the new partition. for example: sda4

10. sudo lvextend -r -l +100%FREE /dev/mapper/VG-lv_root

11. df -h /

12. take snapshot again

参考链接 

virtual machines - Insufficient free space: X extents needed, but only Y available - Server Fault

Linux磁盘扩容三种方式_Hlroliu的博客-CSDN博客_linux磁盘扩容

Linux磁盘扩容 - 简书

lvextend /dev/vg_webserver/lv_root -l+100%FREE

要求系统分配所有闲置空间到选择的逻辑分区

The above command will ask the system to allocate all free space to the selected logical volume, without asking for a specific size.

7.ext4格式磁盘使用resize2fs /根目录

xfs_grofs /根目录

8. df -h 检查磁盘空间 重启服务器服务 重新制作snapshot

报错参考

vCSA警报,磁盘空间不足,解决一例。_u014461454的博客-CSDN博客

创建物理卷报错Can‘t open /dev/sdb1 exclusively. Mounted filesystem?以及对应的解决方法_Kevin古月的博客-CSDN博客

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值