Skip to content

Instantly share code, notes, and snippets.

@gowatana
Last active October 9, 2017 23:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gowatana/dee2c611271586d7057760fd4218187b to your computer and use it in GitHub Desktop.
Save gowatana/dee2c611271586d7057760fd4218187b to your computer and use it in GitHub Desktop.
$images = Get-NTNXImage -IncludeVmDiskSizes
$ctrs = Get-NTNXContainer
$clsuter = Get-NTNXCluster
function timestamp_us2jst($timestamp_us){
$ts_base = Get-Date "1970/1/1"
$ts_base = $ts_base.AddHours(9)
$ts_base.AddSeconds($timestamp_us / 1000000)
}
$images | select `
name,
annotation,
imageType,
vmDiskSize,
imageState,
@{N="createdTimeJST";E={timestamp_us2jst $_.createdTimeInUsecs}},
@{N="updatedTimeJST";E={timestamp_us2jst $_.updatedTimeInUsecs}},
@{N="clusterName";E={
$ctr_uuid = $_.containerUuid
$cluster_uuid = ($ctrs | where {$_.containerUuid -eq $ctr_uuid}).clusterUuid
($clsuter | where {$_.clusterUuid -eq $cluster_uuid}).name
}
},
@{N="containerName";E={
$ctr_uuid = $_.containerUuid;($ctrs | where {$_.containerUuid -eq $ctr_uuid}).name
}
},
uuid,
vmDiskId
@gowatana
Copy link
Author

gowatana commented Oct 9, 2017

下記のように使用するつもり。
http://blog.ntnx.jp/entry/2017/10/10/083900

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment