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 9000@osisaLib03 and 9000@osisalib03 are the same machine. That is enforced by normalising the value on creation, NOT by a comparison override, so every consumer get it.

[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)
Table 1. Parameters
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)
Table 2. Parameters
Name Type Description

serialNumber

SerialNumber

Serial of the machine.

Returns: VirtualMachineKey — The key.