【VMware vSphere】扩容或缩减 vCenter Server 的磁盘空间大小。

news/2025/2/22 13:03:42/文章来源:https://www.cnblogs.com/juniormu/p/18401441

我们在部署 vCenter Server 时,根据不同环境的情况,可以选择不同的部署选项,比如环境中的主机可能运行了 100 个,或者虚拟机运行了 1000 个,此时按照官方推荐的选择“小型环境”部署选项即可满足需求;如果主机超过了 100 个,可能在 1000 个以内,或者虚拟机超过了 1000 个,可能要运行 10000 个,此时推荐应该选择“大型环境”部署选项。

部署选项 CPU 内存
微型环境(最多 10 个主机或 100 个虚拟机) 2 14 GB
小型环境(最多 100 个主机或 1,000 个虚拟机) 4 21 GB
中型环境(最多 400 个主机或 4000 个虚拟机) 8 30 GB
大型环境(最多 1000 个主机或 10000 个虚拟机) 16 39 GB
超大型环境(最多 2000 个主机或 35000 个虚拟机) 24 58 GB 

同样,根据不同的部署选项,也会设置不同的默认存储大小,不过针对不同的部署选项,可以单独将默认存储大小调整为其他存储大小,比如选择“大型”或者“超大型”存储大小。

部署选项 默认存储大小 大型存储大小 超大型存储大小
微型环境(最多 10 个主机或 100 个虚拟机) 579 GB 2019 GB 4279 GB
小型环境(最多 100 个主机或 1000 个虚拟机) 694 GB 2044 GB 4304 GB
中型环境(最多 400 个主机或 4000 个虚拟机) 908 GB 2208 GB 4468 GB
大型环境(最多 1000 个主机或 10000 个虚拟机) 1358 GB 2258 GB 4518 GB
超大型环境(最多 2000 个主机或 35000 个虚拟机) 2283 GB 2383 GB 4643 GB

不同的部署选项会为 vCenter Server 虚拟机分配不同的 CPU 和内存大小,这个很容易理解,因为环境体型越大自然运行负载就越高,即使初始部署的时候分配得较低或较高,这两项也可以在后续使用过程中根据情况随时去调整它。但是,对于部署选项中的存储大小,大家可能就有疑问了,因为不清楚这个环境到底会占用多少存储空间,分配的少了,害怕磁盘被占满导致服务故障,分配的多了,害怕造成磁盘空间浪费。通常情况下,如果没有特殊需求,我们选择部署选项时只需保持默认即可,当对环境中的日志或者数据库类大小有更高需求时,可以选择大一级别选项,不建议一开始选择最高级别选项,因为相对来说,后续想要“扩容”要比“缩减”操作更容易一些。

 

一、vCenter Server 磁盘说明

当 vCenter Server 部署完成之后,我们可以访问“https://vcenter-ip-or-fqdn:5480/#/ui/monitor/disks”管理后台查看磁盘的分区情况。以 vSphere 8 为例,部署时分配的所有存储空间被划分为 17 块磁盘(硬盘格式为VMDK),每块硬盘独立挂载到不同的分区目录以支持不同的用途,将鼠标放在不同分区上面可以显示其功能和用途,通过监控每块磁盘的利用率可以了解不同分区的使用情况。

不是所有的 vCenter Server 版本都会创建这么多的磁盘,并且不同版本所挂载目录的空间大小也不尽相同。以部署选项中的“微型环境”默认存储大小为例,以下是各个 vCenter Server 版本部署之后的磁盘使用情况。注意,如果不是默认存储大小,而是选择了其他类型的存储大小,则部署之后的磁盘分区大小也会跟着发生变化。

vCenter Server 版本 磁盘(VMDK) 挂载目录 默认大小 用途
6.0 VMDK1 / (10 GB)
/boot (132 MB)
SWAP (1 GB)
12 GB Boot directory where the kernel images and boot load configurations are stored
VMDK2 /tmp 1.3 GB Temporary directory used to store temporary files generated or used by services from vCenter Server
VMDK3 SWAP 25 GB Swap directory used when the system is out of memory to swap to disk
VMDK4 /storage/core 25 GB Core directory where core dumps from VPXD process from the vCenter Server are stored
VMDK5 /storage/log 10 GB Log directory where vCenter Server stores all logs for the environment
VMDK6 /storage/db 10 GB VMware Postgres database storage location
VMDK7 /storage/dblog 5 GB VMware Postgres database logging location
VMDK8 /storage/seat 10 GB Stats, Events, Alarms and Tasks (SEAT) directory for VMware Postgres
VMDK9 /storage/netdump 1 GB VMware Netdump collector repository that stores ESXi dumps
VMDK10 /storage/autodeploy 10 GB VMware Auto Deploy repository that stores the thinpackages used for stateless booting of ESXi hosts
VMDK11 /storage/invsvc 5 GB VMware Inventory Service directory where the xDB, Inventory Service bootstrap configuration file, and tomcat configuration files reside
6.5 VMDK1 / (10 GB)
/boot (132 MB)
SWAP (1 GB)
12 GB Directory where the kernel images and boot loader configurations are stored.
VMDK2 /tmp 1.8 GB Directory used to store temporary files generated or used by services from vCenter Server
VMDK3 SWAP 25 GB Directory used when the system is out of memory to swap to disk
VMDK4 /storage/core 25 GB Directory where core dumps from VPXD process from the vCenter Server are stored
VMDK5 /storage/log 10 GB Directory where vCenter Server and Platform Services Controller store all logs for the environment
VMDK6 /storage/db 10 GB VMware Postgres database storage location
VMDK7 /storage/dblog 5 GB VMware Postgres database logging location
VMDK8 /storage/seat 10 GB Stats, Events, Alarms and Tasks (SEAT) directory for VMware Postgres
VMDK9 /storage/netdump 1 GB VMware Netdump collector repository that stores ESXi dumps
VMDK10 /storage/autodeploy 10 GB VMware Auto Deploy repository that stores the thinpackages used for stateless booting of ESXi hosts
VMDK11 /storage/imagebuilder 10 GB VMware Image Builder repository that stores the vSphere image profiles, software depots and VIB packages, such as driver VIBs and update VIBs.
VMDK12 /storage/updatemgr 100 GB VMware Update Manager repository where patches and updates are stored for Virtual Machine and ESXi hosts
6.7 VMDK1 / (10 GB)
/boot (132 MB)
SWAP (1 GB)
12 GB Directory where the kernel images and boot loader configurations are stored.
VMDK2 /tmp 1.8 GB Directory used to store temporary files generated or used by services from vCenter Server
VMDK3 SWAP 25 GB Directory used when the system is out of memory to swap to disk
VMDK4 /storage/core 25 GB Directory where core dumps from VPXD process from the vCenter Server are stored
VMDK5 /storage/log 10 GB Directory where vCenter Server and Platform Services Controller store all logs for the environment
VMDK6 /storage/db 10 GB VMware Postgres database storage location
VMDK7 /storage/dblog 5 GB VMware Postgres database logging location
VMDK8 /storage/seat 10 GB Stats, Events, Alarms and Tasks (SEAT) directory for VMware Postgres
VMDK9 /storage/netdump 1 GB VMware Netdump collector repository that stores ESXi dumps
VMDK10 /storage/autodeploy 10 GB VMware Auto Deploy repository that stores the thinpackages used for stateless booting of ESXi hosts
VMDK11 /storage/imagebuilder 10 GB VMware Image Builder repository that stores the vSphere image profiles, software depots and VIB packages, such as driver VIBs and update VIBs.
VMDK12 /storage/updatemgr 100 GB VMware Update Manager repository where patches and updates are stored for Virtual Machine and ESXi hosts
VMDK13 /storage/archive 50 GB VMware Postgres database’s Write-Ahead Logging (WAL) location
7.0 VMDK1 / (46 GB)
/boot (132 MB)
SWAP (1 GB)
48 GB Directory where the kernel images and boot loader configurations are stored.
VMDK2 /tmp 1.8 GB Directory used to store temporary files generated or used by services from vCenter Server
VMDK3 SWAP 25 GB Directory used when the system is out of memory to swap to disk
VMDK4 /storage/core 25 GB Directory where core dumps from VPXD process from the vCenter Server are stored
VMDK5 /storage/log 10 GB Directory where vCenter Server and Platform Services Controller store all logs for the environment
VMDK6 /storage/db 10 GB VMware Postgres database storage location
VMDK7 /storage/dblog 5 GB VMware Postgres database logging location
VMDK8 /storage/seat 10 GB Stats, Events, Alarms and Tasks (SEAT) directory for VMware Postgres
VMDK9 /storage/netdump 1 GB VMware Netdump collector repository that stores ESXi dumps
VMDK10 /storage/autodeploy 10 GB VMware Auto Deploy repository that stores the thinpackages used for stateless booting of ESXi hosts
VMDK11 /storage/imagebuilder 10 GB VMware Image Builder repository that stores the vSphere image profiles, software depots and VIB packages, such as driver VIBs and update VIBs.
VMDK12 /storage/updatemgr 100 GB VMware Update Manager repository where patches and updates are stored for Virtual Machine and ESXi hosts
VMDK13 /storage/archive 50 GB VMware Postgres database’s Write-Ahead Logging (WAL) location
VMDK14 /storage/vtsdb 10 GB VMware vTSDB Service Repository that stores the stats
VMDK15 /storage/vtsdblog 5 GB VMware vTSDB Service Repository that stores the logs of the service
VMDK16 /storage/lifecycle 100 GB Workload Control Plane service stage directory or software depot, this stores the binaries for install and update/upgrade.
8.0 VMDK1 / (48 GB)
/boot (512 MB)
48 GB Directory where the kernel images and boot loader configurations are stored.
VMDK2 /tmp 5.5 GB Directory used to store temporary files generated or used by services from vCenter Server
VMDK3 SWAP 25 GB Directory used when the system is out of memory to swap to disk
VMDK4 /storage/core 25 GB Directory where core dumps from VPXD process from the vCenter Server are stored
VMDK5 /storage/log 10 GB Directory where vCenter Server and Platform Services Controller store all logs for the environment
VMDK6 /storage/db 10 GB VMware Postgres database storage location
VMDK7 /storage/dblog 15 GB VMware Postgres database logging location
VMDK8 /storage/seat 10 GB Stats, Events, Alarms and Tasks (SEAT) directory for VMware Postgres
VMDK9 /storage/netdump 1 GB VMware Netdump collector repository that stores ESXi dumps
VMDK10 /storage/autodeploy 10 GB VMware Auto Deploy repository that stores the thinpackages used for stateless booting of ESXi hosts
VMDK11 /storage/imagebuilder 10 GB VMware Image Builder repository that stores the vSphere image profiles, software depots and VIB packages, such as driver VIBs and update VIBs.
VMDK12 /storage/updatemgr 100 GB VMware Update Manager repository where patches and updates are stored for Virtual Machine and ESXi hosts
VMDK13 /storage/archive 50 GB VMware Postgres database’s Write-Ahead Logging (WAL) location
VMDK14 /storage/vtsdb 10 GB VMware vTSDB Service Repository that stores the stats
VMDK15 /storage/vtsdblog 5 GB VMware vTSDB Service Repository that stores the logs of the service
VMDK16 /storage/lifecycle 100 GB Workload Control Plane service stage directory or software depot, this stores the binaries for install and update/upgrade.
VMDK17 /storage/lvm_snapshot 150 GB Directory used to store temporary system root

 

二、vCenter Server 磁盘扩容

我们可以通过 VAMI 管理后台监控磁盘/分区的使用情况,vCenter Server 运行一段时间后,当利用率进度条显示为红色之后,说明磁盘空间即将占满,此时应该考虑对磁盘执行扩容操作。如果不及时进行扩容操作,或者因为其他原因导致磁盘的空间被完全占满,可能会造成服务中断以及 vCenter Server 使用故障。

从 vSphere 6.0 开始,vCenter Server 就引入了  Logical Volume Management(LVM)逻辑卷管理,并且可以在不停机的情况下完成磁盘空间的动态扩容,这对于运维和管理来说变得十分方便。但是有一点需要注意的是,vSphere 7.0 及之后的版本不支持调整根分区的大小,如果根分区的空间使用率比较高,可以考虑清除某些日志的方式来降低空间占用。以 vSphere 8.0 为例,下面演示如何对 vCenter Server 进行磁盘扩容。

使用 SSH 以 root 用户连接到 vCenter Server,默认情况下进入 API 命令行。磁盘扩容支持两种方式,一种是 API 方式,另外一种是 Shell 方式,这里先说第一种方式。

输入“storage”并按“Tab”补全,可以看到具有多个用于存储的 API 命令,运行“storage.health.get”可以获取存储的健康状态。

运行“storage.list”可以获取 vCenter Server 所有的磁盘分区。

运行“storage.stats.list”可以获取 vCenter Server 磁盘分区使用情况。Usedkbytes 表示已使用空间大小,Totalkbytes 表示总空间大小,注意单位是 KB;Usedinodes 表示已使用的 inode 数量,Totalinodes 表示总共的 inode 数量。

登录到 vSphere Client,找到 vCenter Server 虚拟机并点击编辑设置,展开硬盘选项卡可以看到 vCenter Server 的所有硬盘,这里演示给“硬盘 5”扩容磁盘空间,也就是“/storage/log”分区,从 25 GB 扩容到 30 GB。注意,如果这里显示是灰色无法修改磁盘的空间大小,可能是因为虚拟机正在快照上运行,可以尝试删除 vCenter Server 虚拟机的所有快照,并在继续之前创建 vCenter Server 基于文件的完整备份。

运行“storage.resize”命令以执行磁盘分区自动扩容,再次查看磁盘分区的空间大小,可以发现已成功增加。

使用 SSH 以 root 用户连接到 vCenter Server,默认情况下进入 API 命令行。使用以下命令开启 vCenter Server 的 Bash Shell 访问,再输入 shell 命令进行连接。

shell.set --enabled true

使用“df -h”或者“lsblk”命令查看磁盘分区及使用情况,然后确定某一个分区是否受影响。

登录到 vSphere Client,找到 vCenter Server 虚拟机并点击编辑设置,展开硬盘选项卡,这里还是演示给“硬盘 5”扩容磁盘空间,从 30 GB 扩容到 40 GB。

直接运行以下脚本,再次查看磁盘分区的使用情况,可以发现磁盘空间大小已成功扩容。

/usr/lib/applmgmt/support/scripts/autogrow.sh

上述过程能够完成对 vCenter Server 磁盘的扩容操作,整个过程应该比较简单,可以根据个人习惯自行选择使用 API 或者 Shell 方式。

 

三、vCenter Server 磁盘缩减

其实应该能发现,上面所演示的 vCenter Server 磁盘空间使用率是极其较小的,这里的环境在部署的时候选择了“大型环境”选项,并且将默认存储大小修改为了“大型存储大小”,所以看起来分配给 vCenter Server 的磁盘空间被浪费了。如果运行很长一段时间后,发现 vCenter Server 的磁盘空间占用率依然非常低的话,说明使用环境与部署选项差距过大,选择低一档的部署选项也能满足需求。

已经部署的 vCenter Server,能不能对其存储空间执行缩减呢?网上有一些文章介绍如何收缩 vCenter Server 的磁盘大小,但是这些方法操作难度较高并且不受官方支持,所以,下面演示一种受支持的方法,用于缩减 vCenter Server 的磁盘空间大小。这种方法其实就是使用 vCenter Server 安装程序执行备份还原过程,因为在还原的第一阶段可以选择我们想要的任何部署选项。有关 vCenter Server 基于文件的备份方法可以参考这篇(使用 SFTP 服务器备份 VCF 核心组件的配置文件。)文章。

运行 vCenter Server 安装程序,选择“还原”选项。

连接到备份服务器并选择 vCenter Server 指定备份文件。

中间过程就省略了,在选择部署大小时,可根据当前 vCenter Server 环境的情况选择合适的部署选项,这里选择“小型环境”即可。

完成第一阶段新 vCenter Server 的部署,点击继续。

开始第二阶段还原过程。

连接到备份服务器。

由于部署选项与备份配置文件不匹配,出现“元数据和系统验证失败/Metadata and system validation failed”错误。

登录到备份服务器,导航到 vCenter Server 的备份目录,找到“backup-metadata.json”备份元数据文件并进行编辑,根据下图修改文件中的“SizeInfo”和“Deployment Type”中的值以匹配在还原第一阶所选择的部署选项。

修改后,重新点击即可验证成功并进入下一步。

完成还原过程。

登录 VAMI,再次点击磁盘监控,可以发现 vCenter Server 磁盘空间大小已成功缩减。

参考类似的方式,也可以在跨版本“升级”过程中对 vCenter Server 磁盘空间进行缩减,比如从 6.5/6.7 升级到 7.0 或者 8.0 时,使用 vCenter Server 安装程序执行第一阶段的部署,然后关闭向导并通过浏览器访问 VAMI 进入第二阶段“升级”,最终完成整个过程。

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.hqwc.cn/news/885399.html

如若内容造成侵权/违法违规/事实不符,请联系编程知识网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

day:3软件测试分类

一、按开发阶段划分 (1)单元测试 (2)集成测试 (3)系统测试 (4)集成测试 二、按查看代码分类 (1)黑盒测试 定义:是一种功能测试,测试中把测试的软件当成一个盒子,不关心盒子内部结构是什么,只关心软件的输入和输出。 例如:一个计算器,输入:1+1 输出:2,正确;…

活动管理神器来袭!板栗看板让你告别繁琐,拥抱高效

变革模型与项目管理工具的结合运用可以形成一个系统化、高效化的变革管理体系。通过明确变革需求与目标、执行变革计划、评估与反馈以及持续优化改进等步骤,可以确保变革的顺利实施和成功落地。项目管理中的变革模型是指一系列指导和管理组织内部变革过程的框架和方法。这些模…

劲爆!微信宣布接入 DeepSeek R1!!

大家好,我是R哥。 太劲爆了,连浓眉大眼的微信现在也接入了 DeepSeek,但还在还处于灰度测试阶段,入口比较隐蔽,要从搜索框下面的「AI 搜索」按钮进去。 如图所示:对于微信这么大一个国民级产品来说,在搜索领域引入 AI,肯定是看中了搜索入口的重要性,接入 DeepSeek 不仅…

懒人福音!一款基于 Go 实现的 Docker 终端管理工具!

lazydocker —— 一个基于 Go 编写实现的终端 Docker 管理 UI 工具,为用户提供了一种更直观、便捷的方式来管理 Docker 容器、镜像、数据卷、网络等资源。大家好,我是 Java陈序员。 之前给大家介绍一个在线的 Docker 可视化管理面板。 运维神器!Docker 可视化管理面板! 今天…

专利线框图绘制和导出,从Blender到3ds max

Blender软件设计3维的模型简单好用, 但是它生成的线框图线条太多,不符合专利要求,如下图: 我的方法是导出fbx格式模型,用下面教程里的方法生成线框图,最后用ps处理了一下, https://www.bilibili.com/video/BV1Bz421o7tq/?spm_id_from=333.337.search-card.all.click&a…

如何安全高效地实现云租户之间文件传输,优化业务效率?

基于提高运营效率、降低成本、增强灵活性和创新性等多方面考,越来越多的企业选择将业务和数据迁移到云端,因此会产生云租户之间文件传输的场景。云租户之间文件传输时可能会面临以下问题: 1.安全性:数据传输过程中可能存在安全隐患,如数据泄露、窃听或篡改等问题,也可能。…

为什么说在企业级应用开发中,后端往往是效率杀手?

大家好,我是张飞洪,感谢您的阅读,我会不定期和你分享学习心得,希望我的文章能成为你成长路上的垫脚石,让我们一起精进。在企业级应用开发中,如果你们团队人员是前后端分离的,你会发现联调让人很不省心,可以说往往是效率杀手,而提供联调的API一般由后端人员提供,为什么…

开源EFCore 对比实体与实际数据库结构的工具-GZY.EFCoreCompare

前言 GZY.EFCoreCompare 是一个用于 对比数据库结构和 EF Core 代码中的 DbContext 的库。 它基于 EF Core 的 Scaffolding 机制,生成 DatabaseModel(从数据库提取的模型), 并与代码中的 DbContext 进行比对,从而找出两者之间的差异。 开源项目地址:GZY.EFCoreCompare欢迎s…

趁着过年的时候手搓了一个低代码框架

这个春节假期,我干了一件大事:春节期间手搓了一个低代码框架——CodeSpirit(码灵)。 为什么手搓低代码框架? 市面上的低代码平台不少,但大多存在“黑箱生成、性能损耗、扩展性差”的痛点。开发者一旦需要深度定制,往往束手无策。而CodeSpirit的初衷是:让全栈开发回归工…

C# TorchSharp 图像分类实战:VGG大规模图像识别的超深度卷积网络

目录VGG大规模图像识别的超深度卷积网络数据集直接下载opendatalab 数据集社区自定义数据集模型训练 教程名称:使用 C# 入门深度学习 作者:痴者工良 教程地址: https://torch.whuanle.cn 电子书仓库:https://github.com/whuanle/cs_pytorch Maomi.Torch 项目仓库:https://…

AI应用实战课学习总结(9)Hello 深度学习

本文介绍了深度学习和神经网络的基本概念,深度学习和传统机器学习的差别,还了解了PyTorch框架,最后通过一个例子演示了如何基于PyTorch使用一个视觉检测模型来快速完成图片的目标检测任务,十分方便。大家好,我是Edison。 最近入坑黄佳老师的《AI应用实战课》,记录下我的学…

CAP与BASE:分布式系统设计的灵魂与妥协

CAP 理论 CAP理论起源于 2000 年,由加州大学伯克利分校的 Eric Brewer 教授在分布式计算原理研讨会(PODC)上提出,因此 CAP 定理又被称作 布鲁尔定理(Brewer’s theorem) 2 年后,麻省理工学院的 Seth Gilbert 和 Nancy Lynch 发表了布鲁尔猜想的证明,CAP 理论正式成为分…