VirtualMachineKey
Primary key of a VirtualMachineSettings.
|
Note
|
There are exactly TWO ways a machine get a key, and they are the two factories below - a raw string constructor is deliberately not part of the intended surface, because the whole point of this type is that a key can no longer be any string somebody happens to hold. Comparison is case-insensitive - a hypervisor round-trip does not preserve casing, so |
[ValueObject<string>]
[Instance("Empty", "")]
public readonly struct VirtualMachineKey : ValueType, IKeyOf<VirtualMachineSettings>
1. Attributes
1.1. Instance
Instance
1.2. ValueObject<string>
ValueObject<string>
2. Properties
2.1. IsEmpty
True when no key was assigned.
public bool IsEmpty { get; }
3. Methods
3.1. FromEnvironment(MachineName, MachineName)
Key a machine that carry no NETSetup serial, by where it live and what it is called.
public static VirtualMachineKey FromEnvironment(MachineName environment, MachineName machine)
| Name | Type | Description |
|---|---|---|
environment |
MachineName |
Environment the machine live on. |
machine |
MachineName |
Name of the machine. |
Returns: VirtualMachineKey — The key.
3.2. FromSerial(SerialNumber)
Key a machine by its NETSetup serial.
public static VirtualMachineKey FromSerial(SerialNumber serialNumber)
| Name | Type | Description |
|---|---|---|
serialNumber |
SerialNumber |
Serial of the machine. |
Returns: VirtualMachineKey — The key.