SoftDeleteMarker

How a virtual machine is marked as DELETED without being destroyed: its name get a Prefix.

Note

A delete that immediately destroy a guest is unrecoverable, and the record that would tell you what was destroyed die with it. So a committed delete only MARK - rename plus stop - and the destruction is a separate, explicit act through osisa.Repository.Contracts.IPermanentDeletions<TEntity>.

The marker live in the NAME on purpose. It survive a restart, a reconnect and a different process, it is visible in every hypervisor UI, and it need no side table - which a marker held anywhere else would.

public static class SoftDeleteMarker

1. Fields

1.1. DnsSafePrefix

The same marker, spelled so a DNS-constrained environment accept it.

public const string DnsSafePrefix

1.2. Prefix

Prefix a soft-deleted machine name carry.

public const char Prefix

2. Methods

2.1. IsMarked(MachineName)

Whether this name is marked as soft-deleted, in either form.

public static bool IsMarked(MachineName name)
Table 1. Parameters
Name Type Description

name

MachineName

Machine name.

Returns: bool — when the name carry a marker.

2.2. Mark(MachineName)

Mark a name as soft-deleted. Marking an already marked name change nothing.

public static MachineName Mark(MachineName name)
Table 2. Parameters
Name Type Description

name

MachineName

Machine name.

Returns: MachineName — The marked name.

2.3. MarkDnsSafe(MachineName, int)

Mark a name in the form a DNS-constrained environment accept.

public static MachineName MarkDnsSafe(MachineName name, int discriminator = 0)
Table 3. Parameters
Name Type Description

name

MachineName

Machine name.

discriminator

int

Something unique WITHIN the environment - a Proxmox vmid. Zero mean none.

Returns: MachineName — The marked name.

2.4. Unmark(MachineName)

Strip the marker, in either form. An unmarked name come back unchanged.

public static MachineName Unmark(MachineName name)
Table 4. Parameters
Name Type Description

name

MachineName

Machine name.

Returns: MachineName — The name without the marker.