In this episode, Sean Donahue looks back at the tech stories from 2022. The highs, lows, and everything in between. What story did we miss? Which stories surprised you in 2022? Please leave your comments below.<\/p>

Have a wonderful 2023!<\/p>

<\/oembed><\/p>

\u00a0<\/p>

If you have any questions, feel free to reach out to me on\u00a0Twitter<\/a>\u00a0and if you haven't already done so, make sure you are subscribed to the show wherever you consume podcasts.<\/p>

\u00a0<\/p>","id":41482,"featuredImage":"https:\/\/uploads-us-west-2.insided.com\/nutanix-us\/attachment\/f38aec9c-1b9f-472b-8bc4-5177f93527b7_thumb.png","label":"Blog","replyCount":0,"views":90,"post":{"id":63100,"author":{"id":7898,"url":"\/members\/aluciani-7898","name":"aluciani","avatar":"https:\/\/uploads-us-west-2.insided.com\/nutanix-us\/icon\/200x200\/77accf89-4f79-48be-81e6-c2ac5507e29b.png","userTitle":"Chevalier","rank":{"isBold":false,"isItalic":false,"isUnderline":false,"name":"Chevalier","color":"#660099"},"userLevel":7},"content":"

In this episode, Sean Donahue looks back at the tech stories from 2022. The highs, lows, and everything in between. What story did we miss? Which stories surprised you in 2022? Please leave your comments below.<\/p>

Have a wonderful 2023!<\/p>

<\/oembed><\/p>

\u00a0<\/p>

If you have any questions, feel free to reach out to me on\u00a0Twitter<\/a>\u00a0and if you haven't already done so, make sure you are subscribed to the show wherever you consume podcasts.<\/p>

\u00a0<\/p>","url":"\/community-blog-154\/nutanix-community-podcast-2022-year-in-review-41482?postid=63100#post63100","creationDate":"2023-01-03T14:40:38+0000","relativeCreationDate":"4 days ago"},"contentType":"article","type":3,"likes":3,"hasCurrentUserLiked":false},"phrases":{"Forum":{"{n} year|{n} years":"{n} year|{n} years","{n} month|{n} months":"{n} month|{n} months","{n} day|{n} days":"{n} day|{n} days","{n} hour|{n} hours":"{n} hour|{n} hours","{n} minute|{n} minutes":"{n} minute|{n} minutes","just":"just now","{plural} ago":"{plural} ago"}}}">

问题

自动删除VM的旧快照的最佳方法是什么?

  • 2022年12月22日
  • 4个答复
  • 63次观点

徽章 +1

自动删除VM的旧快照的最佳方法是什么?


4个答复

UserLevel 4
徽章 +5

你好 @kuldeep@

通过保护域创建快照,如PE> Data Protection,然后输入您需要保留多少个快照,它将保留最新并删除旧的快照

UserLevel 4
徽章 +5

如果已经创建了快照,则可以在此Blogpost中获得带有PowerShell脚本的列表:https://next.nutanix.com/how-it-works-22/list-current-snapshots-via-a-a-script-32693

使用该脚本,您有一些指针可以使用CMDLET删除ntnxsnapshot来清理快照

UserLevel 4
徽章 +5

因为我喜欢上面发布的想法此处并更新脚本以自动删除比给定几天更古老的快照。

更改PE-IP,用户名和密码。并将$删除的日子设置为您喜欢的东西。

Connect -NutanixCluster -Server  -username admin -password nutanix/4U -Acceptinvalidsslcerts -forceedConnection

$删除以下= 30
$ nutsnaps = get-ntnxsnapshot
$ allnutvms = get-ntnxvm |选择uuid,vmname

foreach($ nutsnaps中的$ snap){
美元
$ snaptime = $ snap.createdtime/1000
$ snapdt =(get-date'1/1/1970')。addmilliseconds($ snaptime)
$ actualsnapdt = $ snapdt.tolocaltime()
$ limit =(get-witte).addays( - $ deleteatdays)
if($ limit -lt $ actualsnapdt){
写入主持人“快照” -Nonewline
写入主持人$ snap.snapshotname-foregroundercolor黄色 - nonewline
写入主持人“在VM上” -NONEWLINE
写入主持人$ vmname-foregroundcolor黄色 - nonewline
写入主持人“创建” -nonewline
写入主持人$ muthatesnapdt -foregroundoggroundColor黄色-NoneWline
写入主持人“在极限之内,不会被删除。”
} 别的 {
写入主持人“快照” -Nonewline
写入主持人$ snap.snapshotname-foregroundcolor红色 - nonewline
写入主持人“在VM上” -NONEWLINE
写入主持人$ vmname -foregroundColor红色 - nonewline
写入主持人“创建” -nonewline
写入主持人$ facealsnapdt-foregroundcolor红色-NoneWline
写宿主“比极限年龄更大,将被删除。”
$ remove = remove ntnxsnapshot -uuid $ snap.uuid
}
}

UserLevel 4
徽章 +5

更新:制作了一个更好的版本,并为其创建了博客文章:https://www.jeroentielen.nl/cleanup-nutanix-snapshots-after-amount-days/

回复


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