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"}}}">

解决了

通过脚本列出当前快照


你好,

我是Nutanix的新手,有一个问题。



有人知道是否有一种方法可以通过脚本列出所有当前快照?



我想找出是否有任何挥之不去的快照。



感谢您可能提供的任何建议。
图标

最好的答案Andymlloyd2019年8月19日,13:45

@nfrederickx<\/user-mention> Hi,
\n
\nYou can get a very simple output of VM Name, VM Snapshot Name and Date\/Time taken using the Powershell Cmdlets. Script below should sort you out:
\n
\n## Simple Nutanix All Last Snapshot info Script ##
\n## Andy Lloyd ##
\n
\n$nutsnaps=Get-NTNXSnapshot
\n$allnutvms=Get-NTNXVM | select uuid,vmName
\nforeach ($snap in $nutsnaps)
\n{
\n$vmname= ($allnutvms | where {$_.Uuid -eq $snap.vmUuid}).vmName
\n$snaptime=$snap.createdtime\/1000
\n$snapdt=(Get-Date '1\/1\/1970').AddMilliseconds($snaptime)
\n$actualsnapdt=$snapdt.ToLocalTime()
\n##Write-host $actualsnapdt
\n#Write-host $snap.snapshotname
\nWrite-host \"VM: \" -nonewline; write-host $vmname -foregroundcolor yellow -nonewline; Write-Host \" Last Snapshot Name: \" -nonewline; `
\nwrite-host $snap.snapshotname -foregroundcolor Yellow -nonewline; Write-Host \" Taken: \" -nonewline; Write-host $actualsnapdt -foregroundcolor Yellow
\n}
\n
\nIf this helps you out please mark as Best Answer and Like 🙂
\nMany thanks
\nAndy","className":"post__content__best_answer"}">
查看原件

该主题已关闭以供评论

2个答复

看起来可能有效:https://chrisjeucken.com/2018/07/query-all-snapshots-from-nutanix-ahv/
UserLevel 2
徽章 +2
@nfrederickx你好,



您可以使用PowerShell cmdlet获得VM名称,VM快照名称和日期/时间的非常简单的输出。下面的脚本应该整理出来:



##简单nutanix全部快照信息脚本##

## Andy Lloyd ##



$ 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()

##写入主持人$ mualthsnapdt

#写入主持人$ snap.snapshotname

写入主持人“ vm:” -nonewline;写入主持人$ vmname -foregroundColor Yellow -noneWline;写入主持人“最后一个快照名称:” -nonewline;`

写入host $ snap.snapshotname-foregroundercroundColor Yellow -noneWline;写入主持人“ take:” -nonewline;写入主持人$ muthatesnapdt-前景彩色黄色

}



如果这有帮助您,请标记为最佳答案,喜欢

非常感谢

安迪
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