Join us for a virtual Nutanix User Group meeting with Jarian Gibson as he covers Nutanix Cloud Clusters (NC2) on Azure and AWS with Citrix. <\/span><\/p>

Jarian will take a deep dive into NC2 on Azure architecture and Citrix on NC2 on Azure\u00a0that helps you strengthen your business continuity and disaster recovery position. He\u2019ll also provide the latest updates for NC2 on AWS.<\/span><\/p>

Plus, we're\u00a0giving away a Nutanix suitcase to one lucky winner!\u00a0Opt-in when you register\u00a0to be entered to win.\u00a0<\/p>","author":{"id":113632,"url":"\/members\/karlie-beil-113632","name":"Karlie Beil","avatar":"https:\/\/uploads-us-west-2.insided.com\/nutanix-us\/icon\/200x200\/1581aab3-bcf6-49f4-b2fb-3d11e8c010dc.png","userTitle":"Community Manager","rank":{"isBold":false,"isItalic":false,"isUnderline":false,"name":"Community Manager","color":"#0873ba"},"userLevel":4},"type":"Webinar","url":"https:\/\/next.nutanix.com\/events\/global-nug-nc2-on-azure-and-aws-with-citrix-151","image":"https:\/\/uploads-us-west-2.insided.com\/nutanix-us\/attachment\/f9693b5b-436b-427a-9b98-531b4040ff24_thumb.png","location":"","startsAt":1678298400,"endsAt":1678302000,"contentType":"event","attendees":[],"attendeeCount":0,"isLoggedInUserAttendee":false,"createdAt":"1675974969"},"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个答复
  • 209意见

徽章 +1

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


该主题已关闭以供评论

4个答复

UserLevel 4
徽章 +5

你好 @kuldeep@

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

UserLevel 5
徽章 +5

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

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

UserLevel 5
徽章 +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 -foregroundercolor红色-nonewline
写宿主“比极限年龄更大,将被删除。”
$ remove = remove ntnxsnapshot -uuid $ snap.uuid
}
}

UserLevel 5
徽章 +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