Join this episode for more Stories from the EUC Road as Sean Donahue (Nutanix) and Al Solorzano (E360) tackle this all too familiar question. But does it have to an \u201cOR\u201d statement? Can you have an \u201cAND\u201d statement instead? Tune in to learn more about performance in EUC, happy employees and how you might sleep better at night in the age of Malware and Ransomware.<\/p><\/oembed>

Resources<\/p>

Nutanix AHV群集中每个VM和所有VM的磁盘空间

  • 2020年10月20日
  • 0答复
  • 1236意见

UserLevel 2
徽章

Nutanix的客户使用AHV作为其管理程序通常会在其群集上遇到磁盘空间问题,并且需要评估每个实体正在消耗多少磁盘空间。需要考虑的更重要的因素之一是每个VM占用多少空间。需要有一种简单的方法来运行一个命令并获取每个VM消耗的空间的列表,以便一眼就可以弄清楚哪些是可以立即从集群中删除的VM一些太空开垦。作为奖励,我还包括了命令字符串,该字符串将加起来所有这些数字,并为您提供所有这些VM所消耗的磁盘空间的总数。

我已经想到了以下字符串操作,以便能够获得这些数字:

nutanix@cvm:$ for q in`acli vm.list |awk'{print $ 1}'`; do echo -n“ $ q”;acli vm.get“ $ q” |grep vmdisk_size |awk'{sum+= $ 2}结束{print sum}'|awk'{字节= $ 1/1024/1024/1024;回声;打印字节“ gb”}';完成

nutanix@cvm:$ for q in`acli vm.list |awk'{print $ nf}'|egrep -v uuid`;做acli vm.get“ $ q” |grep vmdisk_size |awk'{sum+= $ 2}结束{print sum}'|awk'{字节= $ 1/1024/1024/1024;回声;打印字节“ GB”}';完成| awk '{total += $1} END {print "\nTotal space consumed by the VMs:", total, "GigaBytes"}'; echo

如上所述,将字符串操作与标准Linux操作(如GREP和AWK)结合使用,并涉及一些数学,我们可以在群集中每个VM占用多少磁盘空间上产生输出。您还可以查看所有这些VM的总磁盘空间已占用了多少。这使您更近一步,即可摆脱低悬挂的水果,并采取一种认知方法来删除其他VM。您决定是否要看森林还是森林中的单个树木!

请注意,以上命令仅用于监视和评估目的,它们不会对Nutanix群集进行任何更改。这为您提供了VM的手柄,让我们解决另一个删除候选者,即以后的帖子中的快照。

删除您可以立即摆脱的任何VM,深呼吸,然后三思而后行,然后删除其他VM。


该主题已关闭以供评论
Learn more about our cookies.<\/a>","cookiepolicy.button":"Accept cookies","cookiepolicy.button.deny":"Deny all","cookiepolicy.link":"Cookie settings","cookiepolicy.modal.title":"Cookie settings","cookiepolicy.modal.content":"We use 3 different kinds of cookies. You can choose which cookies you want to accept. We need basic cookies to make this site work, therefore these are the minimum you can select. Learn more about our cookies.<\/a>","cookiepolicy.modal.level1":"Basic
Functional","cookiepolicy.modal.level2":"Normal
Functional + analytics","cookiepolicy.modal.level3":"Complete
Functional + analytics + social media + embedded videos"}}}">
Baidu