PveHostExtensions

public static class PveHostExtensions

1. Methods

1.1. GetHost(Proxmox, MachineName)

Synchronous companion for callers that already hold a MachineName.

public static SystemManagement.Proxmox.Host GetHost(this Proxmox this, MachineName hostName)
Table 1. Parameters
Name Type Description

this

Proxmox

Connected Proxmox client.

hostName

MachineName

Host machine name.

Returns: SystemManagement.Proxmox.Host — The matching host.

1.2. GetHost(Proxmox, string)

Synchronous companion to NETSetup.Extensions.PveHostExtensions.GetHostAsync(Proxmox,System.String).

public static SystemManagement.Proxmox.Host GetHost(this Proxmox this, string hostName)
Table 2. Parameters
Name Type Description

this

Proxmox

Connected Proxmox client.

hostName

string

Host name, e.g. osisaLib03.

Returns: SystemManagement.Proxmox.Host — The matching host.

1.3. GetHostAsync(Proxmox, string)

Gets a host by its name, without the caller building a MachineName.

public static Task<SystemManagement.Proxmox.Host> GetHostAsync(this Proxmox this, string hostName)
Table 3. Parameters
Name Type Description

this

Proxmox

Connected Proxmox client.

hostName

string

Host name, e.g. osisaLib03.

Returns: Task<SystemManagement.Proxmox.Host> — The matching host.

1.4. GetPveHost(Proxmox, string)

public static Task<SystemManagement.Proxmox.Host> GetPveHost(this Proxmox this, string hostName)
Table 4. Parameters
Name Type Description

this

Proxmox

hostName

string

Returns: Task<SystemManagement.Proxmox.Host>

1.5. NextFreeVirtualMachineId(SystemManagement.Proxmox.Host, int, int)

public static int NextFreeVirtualMachineId(this SystemManagement.Proxmox.Host host, int firstId = 100, int idIncrement = 100)
Table 5. Parameters
Name Type Description

host

SystemManagement.Proxmox.Host

firstId

int

idIncrement

int

Returns: int

1.6. NextSerialNumber(SystemManagement.Proxmox.Host, int, int)

public static SerialNumber NextSerialNumber(this SystemManagement.Proxmox.Host host, int firstId = 100, int idIncrement = 100)
Table 6. Parameters
Name Type Description

host

SystemManagement.Proxmox.Host

firstId

int

idIncrement

int

Returns: SerialNumber

1.7. PickFreeVmId(SystemManagement.Proxmox.Host, int, int)

Returns the lowest unused VM id on this within a range.

public static int PickFreeVmId(this SystemManagement.Proxmox.Host this, int firstId, int count)
Table 7. Parameters
Name Type Description

this

SystemManagement.Proxmox.Host

Host to scan.

firstId

int

First id of the search range.

count

int

Size of the search range.

Returns: int — The lowest free vmid in the range.

1.8. ThrowIfIsNotConnected(Proxmox, string)

Throws when the client has no live connection; otherwise returns it.

public static Proxmox ThrowIfIsNotConnected(this Proxmox this, string target = null)
Table 8. Parameters
Name Type Description

this

Proxmox

Proxmox client to check.

target

string

Optional NON-SECRET endpoint description for the message, e.g. 192.168.3.233:8006.

Returns: Proxmox — The same client, so the check can sit inline in a registration or a chain.