forked from bekimd-ms/AzureStack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgetclusterinfo.ps1
More file actions
38 lines (28 loc) · 1.12 KB
/
Copy pathgetclusterinfo.ps1
File metadata and controls
38 lines (28 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
while( $true )
{
$timestamp = get-date -Format o
Write-Host "-----------------------------------------------------------------------"
Write-Host $timestamp
Write-Host ""
Write-Host "Getting cluster nodes"
$nodes = get-clusternode -Cluster S-Cluster
$data = $nodes | select *
$data | add-member -Type NoteProperty -Name Timestmap -value (get-date -Format o)
$data | export-csv -path "nodes.csv" -NoTypeInformation -Append
Write-Host "Getting cluster volumes"
$vol = Get-ClusterSharedVolume -Cluster S-cluster
$data = $vol | select *
$data | add-member -Type NoteProperty -Name Timestmap -value (get-date -Format o)
$data | export-csv -path "volumes.csv" -NoTypeInformation -Append
Write-Host "Getting cluster VMs"
$vm = @()
foreach( $node in $nodes )
{
Write-host "Loading VMs from node " $node.Name
$vm += @(get-vm -ComputerName $node.Name)
}
Write-host "Exporting VM info "
$data = $vm | select *
$data | add-member -Type NoteProperty -Name Timestmap -value (get-date -Format o)
$data | export-csv -path "vms.csv" -NoTypeInformation -Append
}