forked from PowerCLIGoodies/DRSRule
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDRSRule.init.ps1
69 lines (60 loc) · 1.94 KB
/
DRSRule.init.ps1
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#Requires -Modules VMware.VimAutomation.Core, @{ModuleName="VMware.VimAutomation.Core";ModuleVersion="6.0.0.0"}
$pcliDLL = join-path -path (get-module VMware.VimAutomation.Core).ModuleBase -childpath "VMware.Vim.dll"
Add-Type -ReferencedAssemblies $pcliDll -TypeDefinition @"
using VMware.Vim;
namespace DRSRule {
public class VMGroup {
public string Name;
public string Cluster;
public string[] VM;
public ManagedObjectReference[] VMId;
public bool UserCreated;
public string Type;
// not populated/used
//public string Id;
// Implicit constructor
public VMGroup () {}
}
public class VMHostGroup {
public string Name;
public string Cluster;
public string[] VMHost;
public ManagedObjectReference[] VMHostId;
public bool UserCreated;
public string Type;
//public string Id;
// Implicit constructor
public VMHostGroup () {}
}
public class VMToVMRule {
public string Name;
public string Cluster;
public string ClusterId;
public bool Enabled;
public bool Mandatory;
public bool KeepTogether;
public string[] VM;
public ManagedObjectReference[] VMId;
public bool UserCreated;
public string Type;
// Implicit constructor
public VMToVMRule () {}
}
public class VMToVMHostRule {
public string Name;
public string Cluster;
public string ClusterId;
public bool Enabled;
public bool Mandatory;
// KeepTogether is not a property of this type, but is deduced from which of the AffineHostGroupName/AntiAffineHostGroupName properties is populated
//public bool KeepTogether;
public string VMGroupName;
public string AffineHostGroupName;
public string AntiAffineHostGroupName;
public bool UserCreated;
public string Type;
// Implicit constructor
public VMToVMHostRule () {}
}
}
"@