Documentation
¶
Index ¶
- Constants
- func CheckAgentCompatibility(agent AgentCompatibility, requirements CompatibilityRequirements) error
- func CheckOrchestratorCompatibility(agent AgentCompatibility, serverVersion string) error
- func ErrorCode(err error) string
- func GuestAddress(prefix netip.Prefix, offset int) (netip.Addr, error)
- func LinuxDNSUpdateScript(mac string, dns []string) (string, error)
- func LinuxStaticNetworkBootstrapScript(ip string, prefixLength int, gateway, mac string, dns []string) (string, error)
- func LinuxStaticNetworkConfig(ip string, prefixLength int, gateway, mac string, dns []string) (string, error)
- func MergeApplianceNAT(local *isolatedstate.NATAllocation, orchestratorID string, ...) (isolatedstate.NATAllocation, error)
- func MergeApplianceNetworkCache(local isolatedstate.PrivateNetwork, live appliance.Network, ...) (isolatedstate.PrivateNetwork, error)
- func NormalizeHostAlias(value string) (string, error)
- func NormalizeHumanPrefix(value string) string
- func ParseDNSServers(data string) ([]string, error)
- func PhysicalName(humanPrefix, immutableID string, maxLength int) (string, error)
- func PrivateGateway(prefix netip.Prefix) netip.Addr
- func PrivateSubnet(index int) (netip.Prefix, error)
- func SortedAvailableSubnets(snapshot appliance.DesiredSnapshot, routes []hyperv.IsolatedRouteObservation) []int
- func SubnetIndexFromCIDR(cidr string) (int, error)
- func ValidateApprovedRevision(plan RevisionedPlan, revision string) error
- func ValidateBootstrapPolicy(requirement string, natEnabled, knownNetworkBootstrap, domainJoin bool, ...) error
- func ValidateCascadeResume(stored DeleteOrchestratorPlan, operationID, revision string, ...) error
- func ValidateGenerationConvergence(desired, applied, observed isolatedstate.Generation) error
- func ValidatePhysicalName(value string, maxLength int) error
- func ValidateResumeExact(stored RevisionedPlan, operationID string, resumeExact bool, ...) error
- func WindowsDNSUpdateScript(mac string, dns []string) (string, error)
- func WindowsStaticNetworkScript(ip string, prefixLength int, gateway, mac string, dns []string) (string, error)
- type AddNetworkPlan
- type AddNetworkRequest
- type AgentCompatibility
- type ApplianceClient
- type ApplianceRPCClient
- func (c *ApplianceRPCClient) AdoptRelay(ctx context.Context, orchestratorID string, input RelayInput) (RelayMutationResult, error)
- func (c *ApplianceRPCClient) ApplyPrivateNetwork(ctx context.Context, orchestratorID string, input ApplyPrivateNetworkInput) (NetworkMutationResult, error)
- func (c *ApplianceRPCClient) ApplyRelay(ctx context.Context, orchestratorID string, input RelayInput) (RelayMutationResult, error)
- func (c *ApplianceRPCClient) CheckReadiness(ctx context.Context, orchestratorID string) (ApplianceReadiness, error)
- func (c *ApplianceRPCClient) GetApplianceState(ctx context.Context, orchestratorID string) (appliance.DesiredSnapshot, error)
- func (c *ApplianceRPCClient) GetRelayStats(ctx context.Context, orchestratorID, relayID string) (appliance.RelayStats, error)
- func (c *ApplianceRPCClient) InspectApplianceState(ctx context.Context, orchestratorID string) (ApplianceSnapshot, error)
- func (c *ApplianceRPCClient) ListNATState(ctx context.Context, orchestratorID, networkID, vmID, desiredState string, ...) (NATList, error)
- func (c *ApplianceRPCClient) ListNatState(ctx context.Context, orchestratorID, networkID, vmID, desiredState string, ...) (NATList, error)
- func (c *ApplianceRPCClient) ListRelays(ctx context.Context, orchestratorID, networkID, vmID string, ...) (RelayList, error)
- func (c *ApplianceRPCClient) RebindRelays(ctx context.Context, orchestratorID string, header MutationEnvelope) ([]appliance.Relay, MutationResult, error)
- func (c *ApplianceRPCClient) ReconcileNAT(ctx context.Context, orchestratorID string, header MutationEnvelope, ...) (NATMutationResult, error)
- func (c *ApplianceRPCClient) ReconcileNat(ctx context.Context, orchestratorID string, header MutationEnvelope, ...) (NATMutationResult, error)
- func (c *ApplianceRPCClient) RegisterIsolatedGuest(ctx context.Context, orchestratorID string, input RegisterGuestInput) (GuestMutationResult, error)
- func (c *ApplianceRPCClient) ReleaseAuthority(ctx context.Context, orchestratorID string, envelope MutationEnvelope) error
- func (c *ApplianceRPCClient) ReleaseResources(ctx context.Context, orchestratorID string, request appliance.ReleaseRequest) (appliance.ReleaseResult, error)
- func (c *ApplianceRPCClient) RemoveIsolatedGuest(ctx context.Context, orchestratorID string, header MutationEnvelope, ...) (GuestMutationResult, error)
- func (c *ApplianceRPCClient) RemovePrivateNetwork(ctx context.Context, orchestratorID string, header MutationEnvelope) (NetworkMutationResult, error)
- func (c *ApplianceRPCClient) RemoveRelay(ctx context.Context, orchestratorID string, header MutationEnvelope, ...) (RelayMutationResult, error)
- func (c *ApplianceRPCClient) ReserveResources(ctx context.Context, orchestratorID string, request appliance.ReserveRequest) (appliance.ReserveResult, error)
- func (c *ApplianceRPCClient) SetNATState(ctx context.Context, orchestratorID string, input NATInput) (NATMutationResult, error)
- func (c *ApplianceRPCClient) SetNatState(ctx context.Context, orchestratorID string, input NATInput) (NATMutationResult, error)
- func (c *ApplianceRPCClient) SetParentLifecycle(ctx context.Context, orchestratorID string, envelope MutationEnvelope, ...) error
- func (c *ApplianceRPCClient) ValidateRelay(ctx context.Context, orchestratorID, relayID string, probeTarget bool) (RelayValidation, error)
- type ApplianceReadiness
- type ApplianceSnapshot
- type ApplianceStatusError
- type ApplyIntent
- type ApplyPrivateNetworkInput
- type AuthoritativeReservationRequest
- type AuthoritativeReservationResult
- type Capability
- type CascadeChild
- type CompatibilityError
- type CompatibilityRequirements
- type CreateGuestRequest
- type DeleteOrchestratorPlan
- type DeleteOrchestratorRequest
- type DomainError
- type FenceState
- type GenerationState
- type GuestAllocationClient
- type GuestDomain
- type GuestMutationResult
- type GuestPlan
- type GuestRepairDecision
- type GuestRepairObservation
- type HostCreateFenceRequest
- type HostFenceLease
- type HostIdentityChangedError
- type HostNetworkClient
- type HostPlanningClient
- type HostReference
- type LostNetworkCleanupRequest
- type MutationEnvelope
- type MutationResult
- type NATDNSStatus
- type NATInput
- type NATList
- type NATMutationResult
- type NATValidationMode
- type NetworkCapacityObservation
- type NetworkDomain
- type NetworkHostObservation
- type NetworkHostQuery
- type NetworkID
- type NetworkMutationResult
- type NetworkPhysicalNames
- type NetworkReservationImport
- type NetworkStateClient
- type OperationCapacity
- type OperationID
- type OrchestratorCreatePlan
- type OrchestratorCreateRequest
- type OrchestratorDomain
- func (d OrchestratorDomain) ImportServerCache(ctx context.Context, orchestratorID string) (ServerCacheImport, error)
- func (d OrchestratorDomain) PlanCreateOrReuse(ctx context.Context, request OrchestratorCreateRequest) (OrchestratorCreatePlan, error)
- func (d OrchestratorDomain) Select(ctx context.Context, request SelectionRequest) (SelectionResult, error)
- type OrchestratorID
- type OrchestratorObservation
- type OrchestratorOperation
- type OrchestratorPhysicalNames
- type OrchestratorProbeClient
- type OrchestratorStateClient
- type PhysicalHostID
- type PhysicalHostIdentity
- type PlanAction
- type ProtocolRange
- type ReachableService
- type ReconcileNetworkRequest
- type ReconcileOrchestratorRequest
- type RecoveryResult
- type RecoveryStep
- type RegisterGuestInput
- type RelayID
- type RelayInput
- type RelayList
- type RelayMutationResult
- type RelayValidation
- type RemoveNetworkRequest
- type ReservationRequestBuilder
- type ResourcePreflightInput
- type ResourcePreflightResult
- type RevisionedPlan
- type RouteConflictObservation
- type SelectionRequest
- type SelectionResult
- type SelectionSkip
- type ServerCacheImport
- type StaleOrchestratorMetadataRequest
- type VMID
- type VMPhysicalNames
- type ValidatedNAT
Constants ¶
const ( CapabilityApplianceV1 Capability = "isolated.appliance.v1" CapabilityNetworkV1 Capability = "isolated.network.v1" CapabilityRelayV1 Capability = "isolated.relay.v1" CapabilityNATV1 Capability = "isolated.nat.v1" CapabilityStatsV1 Capability = "isolated.stats.v1" CapabilityAuthorityReleaseV1 Capability = "isolated.authority-release.v1" CapabilityParentLifecycleV1 Capability = "isolated.parent-lifecycle.v1" // Isolated orchestrators have no legacy fallback: authority release and // frozen-parent lifecycle are mandatory protocol-v2 operations. MinimumProtocolVersion uint32 = 2 MaximumProtocolVersion uint32 = 2 )
const ( BootstrapNetworkNone = "none" BootstrapNetworkPreStaged = "pre_staged" BootstrapNetworkNAT = "nat_enabled" )
const ( MaxPhysicalNameLength = 63 MaxWindowsNodeNameLength = 15 )
const ( PrivateNetworkPrefixBits = 26 PrivateSubnetCount = 1 << (PrivateNetworkPrefixBits - 20) FirstGuestAddressOffset = 10 LastGuestAddressOffset = 62 )
const ( MaxNetworksPerOrchestrator = 16 MaxVMsPerOrchestrator = 100 MinimumApplianceSchema = appliance.CurrentSchemaVersion MaximumApplianceSchema = appliance.CurrentSchemaVersion )
const PhysicalHostIdentityVersion = "lablink-physical-host/v1"
const ShortIDLength = 12
Variables ¶
This section is empty.
Functions ¶
func CheckAgentCompatibility ¶
func CheckAgentCompatibility( agent AgentCompatibility, requirements CompatibilityRequirements, ) error
func CheckOrchestratorCompatibility ¶
func CheckOrchestratorCompatibility(agent AgentCompatibility, serverVersion string) error
func MergeApplianceNAT ¶
func MergeApplianceNAT( local *isolatedstate.NATAllocation, orchestratorID string, live appliance.NATState, ) (isolatedstate.NATAllocation, error)
func MergeApplianceNetworkCache ¶
func MergeApplianceNetworkCache( local isolatedstate.PrivateNetwork, live appliance.Network, reservation appliance.Reservation, ) (isolatedstate.PrivateNetwork, error)
MergeApplianceNetworkCache keeps Hyper-V identity from the host/server record while taking live addressing and generations from the appliance.
func NormalizeHostAlias ¶
func NormalizeHumanPrefix ¶
func ParseDNSServers ¶
func PhysicalName ¶
func SortedAvailableSubnets ¶
func SortedAvailableSubnets( snapshot appliance.DesiredSnapshot, routes []hyperv.IsolatedRouteObservation, ) []int
func SubnetIndexFromCIDR ¶
func ValidateApprovedRevision ¶
func ValidateApprovedRevision(plan RevisionedPlan, revision string) error
func ValidateBootstrapPolicy ¶
func ValidateBootstrapPolicy(requirement string, natEnabled, knownNetworkBootstrap, domainJoin bool, services []ReachableService) error
func ValidateCascadeResume ¶
func ValidateCascadeResume( stored DeleteOrchestratorPlan, operationID, revision string, currentChildren []CascadeChild, ) error
func ValidateGenerationConvergence ¶
func ValidateGenerationConvergence( desired, applied, observed isolatedstate.Generation, ) error
func ValidatePhysicalName ¶
func ValidateResumeExact ¶
Types ¶
type AddNetworkPlan ¶
type AddNetworkPlan struct {
Plan RevisionedPlan
Network isolatedstate.PrivateNetwork
Reservation appliance.Reservation
InventoryGeneration uint64
ResultingParentGeneration uint64
Host NetworkHostObservation
Imported bool
CollisionRetries int
}
type AddNetworkRequest ¶
type AddNetworkRequest struct {
OperationID string
Orchestrator isolatedstate.Orchestrator
NetworkID NetworkID
DisplayName string
ExpectedParentGeneration isolatedstate.Generation
ExplicitSubnetIndex *int
Routes []hyperv.IsolatedRouteObservation
HostFence int64
HostLeaseID string
HostLeaseSecret []byte
HostLeaseExpiresUnix int64
}
type AgentCompatibility ¶
type ApplianceClient ¶
type ApplianceClient interface {
GetApplianceState(context.Context, string) (appliance.DesiredSnapshot, error)
ReserveResources(context.Context, string, appliance.ReserveRequest) (appliance.ReserveResult, error)
}
type ApplianceRPCClient ¶
type ApplianceRPCClient struct {
// contains filtered or unexported fields
}
ApplianceRPCClient adapts registered isolated-orchestrator nodes to the appliance domain interfaces.
func NewApplianceClient ¶
func NewApplianceClient( reg *registry.Registry, pool *agentclient.Pool, serverVersion string, ) *ApplianceRPCClient
NewApplianceClient creates the production appliance adapter.
func NewApplianceRPCClient ¶
func NewApplianceRPCClient( reg applianceNodeRegistry, pool applianceClientPool, serverVersion string, ) *ApplianceRPCClient
NewApplianceRPCClient creates a fail-closed appliance API adapter.
func (*ApplianceRPCClient) AdoptRelay ¶
func (c *ApplianceRPCClient) AdoptRelay( ctx context.Context, orchestratorID string, input RelayInput, ) (RelayMutationResult, error)
func (*ApplianceRPCClient) ApplyPrivateNetwork ¶
func (c *ApplianceRPCClient) ApplyPrivateNetwork( ctx context.Context, orchestratorID string, input ApplyPrivateNetworkInput, ) (NetworkMutationResult, error)
func (*ApplianceRPCClient) ApplyRelay ¶
func (c *ApplianceRPCClient) ApplyRelay( ctx context.Context, orchestratorID string, input RelayInput, ) (RelayMutationResult, error)
func (*ApplianceRPCClient) CheckReadiness ¶
func (c *ApplianceRPCClient) CheckReadiness( ctx context.Context, orchestratorID string, ) (ApplianceReadiness, error)
func (*ApplianceRPCClient) GetApplianceState ¶
func (c *ApplianceRPCClient) GetApplianceState( ctx context.Context, orchestratorID string, ) (appliance.DesiredSnapshot, error)
GetApplianceState implements ApplianceClient.
func (*ApplianceRPCClient) GetRelayStats ¶
func (c *ApplianceRPCClient) GetRelayStats( ctx context.Context, orchestratorID, relayID string, ) (appliance.RelayStats, error)
func (*ApplianceRPCClient) InspectApplianceState ¶
func (c *ApplianceRPCClient) InspectApplianceState( ctx context.Context, orchestratorID string, ) (ApplianceSnapshot, error)
func (*ApplianceRPCClient) ListNATState ¶
func (*ApplianceRPCClient) ListNatState ¶
func (c *ApplianceRPCClient) ListNatState( ctx context.Context, orchestratorID, networkID, vmID, desiredState string, pageSize uint32, pageToken string, ) (NATList, error)
ListNatState is the generated-RPC-casing alias for ListNATState.
func (*ApplianceRPCClient) ListRelays ¶
func (*ApplianceRPCClient) RebindRelays ¶
func (c *ApplianceRPCClient) RebindRelays( ctx context.Context, orchestratorID string, header MutationEnvelope, ) ([]appliance.Relay, MutationResult, error)
func (*ApplianceRPCClient) ReconcileNAT ¶
func (c *ApplianceRPCClient) ReconcileNAT( ctx context.Context, orchestratorID string, header MutationEnvelope, networkID string, ) (NATMutationResult, error)
func (*ApplianceRPCClient) ReconcileNat ¶
func (c *ApplianceRPCClient) ReconcileNat( ctx context.Context, orchestratorID string, header MutationEnvelope, networkID string, ) (NATMutationResult, error)
ReconcileNat is the generated-RPC-casing alias for ReconcileNAT.
func (*ApplianceRPCClient) RegisterIsolatedGuest ¶
func (c *ApplianceRPCClient) RegisterIsolatedGuest( ctx context.Context, orchestratorID string, input RegisterGuestInput, ) (GuestMutationResult, error)
func (*ApplianceRPCClient) ReleaseAuthority ¶
func (c *ApplianceRPCClient) ReleaseAuthority( ctx context.Context, orchestratorID string, envelope MutationEnvelope, ) error
func (*ApplianceRPCClient) ReleaseResources ¶
func (c *ApplianceRPCClient) ReleaseResources( ctx context.Context, orchestratorID string, request appliance.ReleaseRequest, ) (appliance.ReleaseResult, error)
func (*ApplianceRPCClient) RemoveIsolatedGuest ¶
func (c *ApplianceRPCClient) RemoveIsolatedGuest( ctx context.Context, orchestratorID string, header MutationEnvelope, networkID string, ) (GuestMutationResult, error)
func (*ApplianceRPCClient) RemovePrivateNetwork ¶
func (c *ApplianceRPCClient) RemovePrivateNetwork( ctx context.Context, orchestratorID string, header MutationEnvelope, ) (NetworkMutationResult, error)
func (*ApplianceRPCClient) RemoveRelay ¶
func (c *ApplianceRPCClient) RemoveRelay( ctx context.Context, orchestratorID string, header MutationEnvelope, vmID, networkID string, ) (RelayMutationResult, error)
func (*ApplianceRPCClient) ReserveResources ¶
func (c *ApplianceRPCClient) ReserveResources( ctx context.Context, orchestratorID string, request appliance.ReserveRequest, ) (appliance.ReserveResult, error)
ReserveResources implements ApplianceClient.
func (*ApplianceRPCClient) SetNATState ¶
func (c *ApplianceRPCClient) SetNATState( ctx context.Context, orchestratorID string, input NATInput, ) (NATMutationResult, error)
func (*ApplianceRPCClient) SetNatState ¶
func (c *ApplianceRPCClient) SetNatState( ctx context.Context, orchestratorID string, input NATInput, ) (NATMutationResult, error)
SetNatState is the generated-RPC-casing alias for SetNATState.
func (*ApplianceRPCClient) SetParentLifecycle ¶
func (c *ApplianceRPCClient) SetParentLifecycle( ctx context.Context, orchestratorID string, envelope MutationEnvelope, state string, newParentGeneration uint64, ) error
func (*ApplianceRPCClient) ValidateRelay ¶
func (c *ApplianceRPCClient) ValidateRelay( ctx context.Context, orchestratorID, relayID string, probeTarget bool, ) (RelayValidation, error)
type ApplianceReadiness ¶
type ApplianceReadiness struct {
Node string
AgentVersion string
Capabilities []string
ProtocolVersion uint32
Ready bool
ApplianceGeneration uint64
Error string
}
ApplianceReadiness is the capability and readiness result reported by an orchestrator agent.
type ApplianceSnapshot ¶
type ApplianceSnapshot struct {
SchemaVersion uint32
ProtocolVersion uint32
Ready bool
ApplianceGeneration uint64
InventoryGeneration uint64
Fence FenceState
MainIPv4 string
PolicyVerified bool
IPv4Forwarding bool
Error string
Desired appliance.DesiredSnapshot
ApplyIntents []ApplyIntent
}
ApplianceSnapshot contains the complete paged appliance inventory.
type ApplianceStatusError ¶
type ApplianceStatusError struct {
Status *status.Status
Code appliance.ErrorCode
ResourceID string
InventoryGeneration uint64
Generation GenerationState
Fence FenceState
Collision *appliance.CollisionError
// contains filtered or unexported fields
}
ApplianceStatusError preserves the original gRPC status and details while exposing the appliance domain code through errors.As and ErrorCodeOf.
func (*ApplianceStatusError) Error ¶
func (e *ApplianceStatusError) Error() string
func (*ApplianceStatusError) GRPCStatus ¶
func (e *ApplianceStatusError) GRPCStatus() *status.Status
func (*ApplianceStatusError) Unwrap ¶
func (e *ApplianceStatusError) Unwrap() error
type ApplyIntent ¶
type ApplyIntent struct {
MutationID string
ResourceKind string
ResourceID string
DesiredGeneration uint64
ParentGeneration uint64
Fence uint64
SemanticHash string
CompiledHash string
Phase string
Error string
CreatedAtUnix int64
UpdatedAtUnix int64
}
ApplyIntent is an incomplete or recoverable appliance mutation.
type AuthoritativeReservationRequest ¶
type AuthoritativeReservationRequest struct {
OrchestratorID string
Explicit bool
MaxAttempts int
Build ReservationRequestBuilder
}
type AuthoritativeReservationResult ¶
type AuthoritativeReservationResult struct {
Result appliance.ReserveResult
Attempts int
}
func ReserveAuthoritativeResources ¶
func ReserveAuthoritativeResources( ctx context.Context, client ApplianceClient, request AuthoritativeReservationRequest, ) (AuthoritativeReservationResult, error)
ReserveAuthoritativeResources implements the appliance-authoritative half of the allocation handshake. The caller imports only the returned accepted values into its server cache.
type Capability ¶
type Capability string
func RequiredOrchestratorCapabilities ¶
func RequiredOrchestratorCapabilities() []Capability
type CascadeChild ¶
type CascadeChild struct {
ResourceType string
ResourceID string
Action cascadeauth.Action
ExpectedHostIdentity string
ExpectedApplianceIdentity string
ExpectedGeneration isolatedstate.Generation
ExpectedIncarnation isolatedstate.Incarnation
ExpectedImmutableIdentity string
}
type CompatibilityError ¶
type CompatibilityError struct {
Code string
Node string
AgentVersion string
ServerVersion string
MissingCapabilities []Capability
ProtocolVersion uint32
SupportedProtocol ProtocolRange
}
func (*CompatibilityError) Error ¶
func (e *CompatibilityError) Error() string
type CompatibilityRequirements ¶
type CompatibilityRequirements struct {
Capabilities []Capability
ProtocolRange ProtocolRange
ServerVersion string
}
func OrchestratorCompatibilityRequirements ¶
func OrchestratorCompatibilityRequirements(serverVersion string) CompatibilityRequirements
func (CompatibilityRequirements) Validate ¶
func (r CompatibilityRequirements) Validate() error
type CreateGuestRequest ¶
type CreateGuestRequest struct {
OperationID string
VMID VMID
RelayID RelayID
Network isolatedstate.PrivateNetwork
Orchestrator isolatedstate.Orchestrator
DisplayName string
GuestOS isolatedstate.GuestOS
ProfileName string
NATEnabled bool
BootstrapNetworkRequirement string
KnownNetworkBootstrap bool
DomainJoin bool
ReachableServices []ReachableService
ExpectedParentGeneration isolatedstate.Generation
HostFence int64
HostLeaseID string
HostLeaseSecret []byte
HostLeaseExpiresUnix int64
StorageRoot string
VMPath string
VHDPath string
}
type DeleteOrchestratorPlan ¶
type DeleteOrchestratorPlan struct {
Plan RevisionedPlan
Authority isolatedstate.CascadeAuthority
}
func BuildOrchestratorDeletePlan ¶
func BuildOrchestratorDeletePlan(request DeleteOrchestratorRequest) (DeleteOrchestratorPlan, error)
func RestoreApprovedOrchestratorDeletePlan ¶
func RestoreApprovedOrchestratorDeletePlan( plan RevisionedPlan, hostFence int64, ) (DeleteOrchestratorPlan, error)
RestoreApprovedOrchestratorDeletePlan reconstructs the immutable cascade authority from the stored approved plan without replanning against the post-freeze parent generation.
type DeleteOrchestratorRequest ¶
type DeleteOrchestratorRequest struct {
OperationID string
Orchestrator isolatedstate.Orchestrator
Cascade bool
Children []CascadeChild
ExpectedGeneration isolatedstate.Generation
}
type DomainError ¶
func (*DomainError) Error ¶
func (e *DomainError) Error() string
type FenceState ¶
type FenceState struct {
PhysicalHostID string
HostFence uint64
HostLeaseID string
ParentResourceID string
ParentGeneration uint64
Frozen bool
Deleting bool
Lost bool
}
FenceState describes the accepted physical-host authority without exposing its lease secret.
type GenerationState ¶
GenerationState is the version tuple returned for a durable mutation.
type GuestAllocationClient ¶
type GuestAllocationClient interface {
GetApplianceState(context.Context, string) (appliance.DesiredSnapshot, error)
ReserveResources(context.Context, string, appliance.ReserveRequest) (appliance.ReserveResult, error)
}
type GuestDomain ¶
type GuestDomain struct {
Appliance GuestAllocationClient
}
func (GuestDomain) ReserveAndPlan ¶
func (d GuestDomain) ReserveAndPlan(ctx context.Context, request CreateGuestRequest) (GuestPlan, error)
type GuestMutationResult ¶
type GuestMutationResult struct {
Guest appliance.Guest
Mutation MutationResult
Pending bool
}
type GuestPlan ¶
type GuestPlan struct {
VM isolatedstate.IsolatedVM `json:"vm"`
Relay isolatedstate.RelayAllocation `json:"relay"`
NAT isolatedstate.NATAllocation `json:"nat"`
Reservations []appliance.Reservation `json:"reservations"`
ResultingParentGeneration uint64 `json:"resulting_parent_generation"`
BootstrapNetworkRequirement string `json:"bootstrap_network_requirement"`
ReachableServices []ReachableService `json:"reachable_services,omitempty"`
}
type GuestRepairDecision ¶
type GuestRepairDecision struct {
Recreate bool `json:"recreate"`
NextIncarnation isolatedstate.Incarnation `json:"next_incarnation"`
Reason string `json:"reason"`
}
func DecideGuestRepair ¶
func DecideGuestRepair(vm isolatedstate.IsolatedVM, observation GuestRepairObservation, repairErr error) GuestRepairDecision
type GuestRepairObservation ¶
type HostCreateFenceRequest ¶
type HostCreateFenceRequest struct {
PhysicalHostID string
HostNode string
OperationID string
LockKey hyperv.IsolatedResourceLockKey
}
type HostFenceLease ¶
type HostFenceLease struct {
LeaseID string
LeaseSecret string
ExpiresAtUnix int64
Fence int64
LockKey hyperv.IsolatedResourceLockKey
}
func (HostFenceLease) Validate ¶
func (l HostFenceLease) Validate(expectedLock hyperv.IsolatedResourceLockKey) error
type HostIdentityChangedError ¶
type HostIdentityChangedError struct {
Alias string
Expected PhysicalHostID
Observed PhysicalHostID
}
func (*HostIdentityChangedError) Error ¶
func (e *HostIdentityChangedError) Error() string
type HostNetworkClient ¶
type HostNetworkClient interface {
ObserveNetwork(context.Context, NetworkHostQuery) (NetworkHostObservation, error)
}
type HostPlanningClient ¶
type HostPlanningClient interface {
AcquireOrchestratorCreateFence(context.Context, HostCreateFenceRequest) (HostFenceLease, error)
ReleaseOrchestratorCreateFence(context.Context, HostCreateFenceRequest, HostFenceLease) error
ReconcileStaleOrchestratorMetadata(context.Context, StaleOrchestratorMetadataRequest) error
PreflightOrchestrator(context.Context, ResourcePreflightInput) (ResourcePreflightResult, error)
}
type HostReference ¶
type HostReference struct {
Alias string
PhysicalID PhysicalHostID
}
func NewHostReference ¶
func NewHostReference(alias string, physicalID PhysicalHostID) (HostReference, error)
func (HostReference) CanonicalKey ¶
func (r HostReference) CanonicalKey() string
func (HostReference) SamePhysicalHost ¶
func (r HostReference) SamePhysicalHost(other HostReference) bool
func (HostReference) Validate ¶
func (r HostReference) Validate() error
func (HostReference) VerifyObserved ¶
func (r HostReference) VerifyObserved(observed PhysicalHostID) error
type LostNetworkCleanupRequest ¶
type LostNetworkCleanupRequest struct {
OperationID string
Network isolatedstate.PrivateNetwork
Authority isolatedstate.CascadeAuthority
}
type MutationEnvelope ¶
type MutationEnvelope struct {
Header appliance.MutationHeader
PhysicalHostID string
HostLeaseID string
HostLeaseSecret []byte
HostLeaseExpiresUnix int64
CascadeOperationID string
CascadePlanRevision string
CascadePlanHash string
CascadeItemID string
CascadeResourceKind string
CascadeAction string
CascadeItems []appliance.CascadeAuthorityItem
}
MutationEnvelope contains the complete mutation authority sent on the wire.
type MutationResult ¶
type MutationResult struct {
MutationID string
SemanticHash string
CompiledHash string
Generation GenerationState
Replayed bool
ApplianceGeneration uint64
Pending bool
}
MutationResult is the typed durable result of an appliance mutation.
type NATDNSStatus ¶
type NATDNSStatus struct {
NetworkCopiedJSON string `json:"network_copied_json"`
GuestCopiedJSON string `json:"guest_copied_json"`
CopyDrift bool `json:"copy_drift"`
Pending *isolatedstate.GuestPendingUpdate `json:"pending_update,omitempty"`
}
func BuildNATDNSStatus ¶
func BuildNATDNSStatus( network isolatedstate.PrivateNetwork, vm isolatedstate.IsolatedVM, pending *isolatedstate.GuestPendingUpdate, ) NATDNSStatus
type NATInput ¶
type NATInput struct {
Header MutationEnvelope
ReservationID string
NetworkID string
DesiredState string
ConntrackMark uint32
}
type NATMutationResult ¶
type NATMutationResult struct {
NAT appliance.NATState
Mutation MutationResult
Pending bool
}
type NATValidationMode ¶
type NATValidationMode int
const ( NATValidateMutation NATValidationMode = iota NATValidateImport )
type NetworkCapacityObservation ¶
type NetworkCapacityObservation struct {
Limit int
Used int
AvailableNetworkSlots int
AvailableSubnetIndexes []int
RouteConflicts []RouteConflictObservation
}
func ObserveNetworkCapacity ¶
func ObserveNetworkCapacity( snapshot appliance.DesiredSnapshot, routes []hyperv.IsolatedRouteObservation, ) NetworkCapacityObservation
type NetworkDomain ¶
type NetworkDomain struct {
State NetworkStateClient
Appliance ApplianceClient
Host HostNetworkClient
}
func (NetworkDomain) BuildRemovePlan ¶
func (d NetworkDomain) BuildRemovePlan( ctx context.Context, request RemoveNetworkRequest, ) (RevisionedPlan, error)
func (NetworkDomain) ReserveAndPlan ¶
func (d NetworkDomain) ReserveAndPlan( ctx context.Context, request AddNetworkRequest, ) (AddNetworkPlan, error)
type NetworkHostObservation ¶
type NetworkHostObservation struct {
SwitchExists bool
SwitchName string
SwitchGUID string
SwitchPrivate bool
HostNICCount int
ConnectedAdapters int
SwitchOwned bool
OwnedOrchestratorID string
OwnedNetworkID string
AdapterExists bool
AdapterName string
AdapterID string
AdapterMAC string
AdapterSwitchGUID string
AdapterOwned bool
}
type NetworkHostQuery ¶
type NetworkMutationResult ¶
type NetworkMutationResult struct {
Network appliance.Network
Mutation MutationResult
Pending bool
}
type NetworkPhysicalNames ¶
func NetworkNames ¶
func NetworkNames(id NetworkID) (NetworkPhysicalNames, error)
type NetworkReservationImport ¶
type NetworkReservationImport struct {
NetworkID string
OrchestratorID string
ReservationID string
SubnetIndex int
CIDR string
GatewayIPv4 string
OrchestratorMAC string
DesiredGeneration isolatedstate.Generation
AppliedGeneration isolatedstate.Generation
ObservedGeneration isolatedstate.Generation
HyperVSwitchGUID string
OrchestratorAdapterID string
}
type NetworkStateClient ¶
type NetworkStateClient interface {
ListNetworks(context.Context, string) ([]isolatedstate.PrivateNetwork, error)
CountActiveVMs(context.Context, string) (int, error)
ImportNetworkReservation(context.Context, NetworkReservationImport) error
}
type OperationCapacity ¶
type OperationCapacity struct {
FreeSubnets int
PrivateAdapterSlots int
SwitchSlots int
HostResourcesAvailable bool
FreeGuestIPs int
FreeMACs int
FreeRelayPorts int
FreeConntrackMarks int
GuestSlots int
NATSupported bool
ReservedConntrackMark bool
ExistingOrchestratorCount int
}
func (OperationCapacity) Supports ¶
func (c OperationCapacity) Supports(operation OrchestratorOperation) error
type OperationID ¶
type OperationID string
func NewOperationID ¶
func NewOperationID() (OperationID, error)
func ParseOperationID ¶
func ParseOperationID(value string) (OperationID, error)
func (OperationID) Short ¶
func (id OperationID) Short() string
func (OperationID) String ¶
func (id OperationID) String() string
func (OperationID) Validate ¶
func (id OperationID) Validate() error
type OrchestratorCreatePlan ¶
type OrchestratorCreatePlan struct {
Plan RevisionedPlan
Names OrchestratorPhysicalNames
Lease HostFenceLease
Preflight ResourcePreflightResult
Reused *SelectionResult
}
type OrchestratorCreateRequest ¶
type OrchestratorCreateRequest struct {
OperationID string
PhysicalHostID string
HostNode string
DisplayName string
ProfileName string
MainVSwitch string
OrchestratorID OrchestratorID
ProjectedStorageBytes int64
ExistingReservedMemoryMB int
ServerVersion string
PostFenceTimeout time.Duration
Progress func(string, string)
}
type OrchestratorDomain ¶
type OrchestratorDomain struct {
State OrchestratorStateClient
Probe OrchestratorProbeClient
Host HostPlanningClient
Appliance ApplianceClient
}
func (OrchestratorDomain) ImportServerCache ¶
func (d OrchestratorDomain) ImportServerCache(ctx context.Context, orchestratorID string) (ServerCacheImport, error)
func (OrchestratorDomain) PlanCreateOrReuse ¶
func (d OrchestratorDomain) PlanCreateOrReuse( ctx context.Context, request OrchestratorCreateRequest, ) (OrchestratorCreatePlan, error)
func (OrchestratorDomain) Select ¶
func (d OrchestratorDomain) Select(ctx context.Context, request SelectionRequest) (SelectionResult, error)
type OrchestratorID ¶
type OrchestratorID string
func NewOrchestratorID ¶
func NewOrchestratorID() (OrchestratorID, error)
func ParseOrchestratorID ¶
func ParseOrchestratorID(value string) (OrchestratorID, error)
func (OrchestratorID) Short ¶
func (id OrchestratorID) Short() string
func (OrchestratorID) String ¶
func (id OrchestratorID) String() string
func (OrchestratorID) Validate ¶
func (id OrchestratorID) Validate() error
type OrchestratorObservation ¶
type OrchestratorObservation struct {
Record isolatedstate.Orchestrator
HostReachable bool
VMState string
MainNICHealthy bool
AgentAuthenticated bool
Agent AgentCompatibility
ApplianceReady bool
AppliancePolicyVerified bool
ApplianceSchema int
ApplyIntentError string
RouteConflict bool
ImmutableIdentityMatch bool
Capacity OperationCapacity
}
type OrchestratorOperation ¶
type OrchestratorOperation string
const ( OperationAddNetwork OrchestratorOperation = "add_network" OperationAddGuest OrchestratorOperation = "add_guest" OperationEnableNAT OrchestratorOperation = "enable_nat" OperationReconcile OrchestratorOperation = "reconcile" )
type OrchestratorPhysicalNames ¶
func OrchestratorNames ¶
func OrchestratorNames(id OrchestratorID) (OrchestratorPhysicalNames, error)
type OrchestratorProbeClient ¶
type OrchestratorProbeClient interface {
ObserveOrchestrator(context.Context, isolatedstate.Orchestrator) (OrchestratorObservation, error)
RecoverOrchestrator(context.Context, isolatedstate.Orchestrator) (RecoveryResult, error)
}
type OrchestratorStateClient ¶
type OrchestratorStateClient interface {
ListOrchestrators(context.Context, string) ([]isolatedstate.Orchestrator, error)
GetOrchestrator(context.Context, string) (isolatedstate.Orchestrator, error)
ImportApplianceCache(context.Context, ServerCacheImport) error
}
type PhysicalHostID ¶
type PhysicalHostID string
func ParsePhysicalHostID ¶
func ParsePhysicalHostID(value string) (PhysicalHostID, error)
func (PhysicalHostID) String ¶
func (id PhysicalHostID) String() string
func (PhysicalHostID) Validate ¶
func (id PhysicalHostID) Validate() error
type PhysicalHostIdentity ¶
type PhysicalHostIdentity struct {
MachineGUID string
SMBIOSUUID string
ID PhysicalHostID
}
func DerivePhysicalHostIdentity ¶
func DerivePhysicalHostIdentity(machineGUID, smbiosUUID string) (PhysicalHostIdentity, error)
type PlanAction ¶
type PlanAction struct {
Phase string `json:"phase"`
Action string `json:"action"`
ResourceType string `json:"resource_type"`
ResourceID string `json:"resource_id"`
ExpectedIdentity string `json:"expected_identity,omitempty"`
ExpectedGeneration int64 `json:"expected_generation"`
NewGeneration int64 `json:"new_generation"`
}
type ProtocolRange ¶
func (ProtocolRange) Contains ¶
func (r ProtocolRange) Contains(version uint32) bool
func (ProtocolRange) Validate ¶
func (r ProtocolRange) Validate() error
type ReachableService ¶
type ReconcileNetworkRequest ¶
type ReconcileNetworkRequest struct {
OperationID string
Network isolatedstate.PrivateNetwork
RefreshDNS bool
ExpectedGeneration isolatedstate.Generation
Host NetworkHostObservation
}
type ReconcileOrchestratorRequest ¶
type ReconcileOrchestratorRequest struct {
OperationID string
Orchestrator isolatedstate.Orchestrator
RefreshDNS bool
RepairRegistry bool
ExpectedGeneration isolatedstate.Generation
}
type RecoveryResult ¶
type RecoveryResult struct {
Observation OrchestratorObservation
Steps []RecoveryStep
}
type RecoveryStep ¶
type RegisterGuestInput ¶
type RegisterGuestInput struct {
Header MutationEnvelope
ReservationID string
NetworkID string
IPv4 string
MAC string
}
type RelayInput ¶
type RelayMutationResult ¶
type RelayMutationResult struct {
Relay appliance.Relay
Mutation MutationResult
Pending bool
}
type RelayValidation ¶
type RemoveNetworkRequest ¶
type RemoveNetworkRequest struct {
OperationID string
Network isolatedstate.PrivateNetwork
ExpectedGeneration isolatedstate.Generation
Host NetworkHostObservation
}
type ReservationRequestBuilder ¶
type ReservationRequestBuilder func( appliance.DesiredSnapshot, int, ) (appliance.ReserveRequest, error)
type ResourcePreflightInput ¶
type ResourcePreflightInput struct {
PhysicalHostID string
HostNode string
MainVSwitch string
ProfileName string
ProjectedMemoryMB int
ProjectedStorageBytes int64
ExistingOrchestratorCount int
AggregateReservedMemoryMB int
RequiredPrivateAdapterSlots int
RequiredSwitchSlots int
RequiredFreeSubnets int
RequiredRelayPorts int
RequiredGuestSlots int
}
type ResourcePreflightResult ¶
type RevisionedPlan ¶
type RevisionedPlan struct {
Kind string `json:"kind"`
OperationID string `json:"operation_id"`
ResourceID string `json:"resource_id"`
SemanticHash string `json:"semantic_hash"`
PlanHash string `json:"plan_hash"`
Revision string `json:"revision"`
Actions []PlanAction `json:"actions"`
Inputs map[string]any `json:"inputs"`
}
func BuildLostNetworkCleanupPlan ¶
func BuildLostNetworkCleanupPlan(request LostNetworkCleanupRequest) (RevisionedPlan, error)
func BuildNetworkReconcilePlan ¶
func BuildNetworkReconcilePlan(request ReconcileNetworkRequest) (RevisionedPlan, error)
func BuildOrchestratorReconcilePlan ¶
func BuildOrchestratorReconcilePlan(request ReconcileOrchestratorRequest) (RevisionedPlan, error)
type RouteConflictObservation ¶
type RouteConflictObservation struct {
Candidate netip.Prefix
Route hyperv.IsolatedRouteObservation
}
func FindPrivateRouteConflicts ¶
func FindPrivateRouteConflicts( candidate netip.Prefix, routes []hyperv.IsolatedRouteObservation, ) []RouteConflictObservation
type SelectionRequest ¶
type SelectionRequest struct {
PhysicalHostID string
ExplicitOrchestrator string
Operation OrchestratorOperation
ServerVersion string
}
type SelectionResult ¶
type SelectionResult struct {
Orchestrator isolatedstate.Orchestrator
Observation OrchestratorObservation
Recovery []RecoveryStep
Skipped []SelectionSkip
}
type SelectionSkip ¶
type SelectionSkip struct {
OrchestratorID string
Code string
Reason string
Recovery []RecoveryStep
}
type ServerCacheImport ¶
type VMPhysicalNames ¶
func VMNames ¶
func VMNames(id VMID) (VMPhysicalNames, error)
type ValidatedNAT ¶
type ValidatedNAT struct {
Reservation appliance.Reservation
Guest appliance.Guest
Live appliance.NATState
}
func ValidateNATIdentity ¶
func ValidateNATIdentity( orchestrator isolatedstate.Orchestrator, network isolatedstate.PrivateNetwork, vm isolatedstate.IsolatedVM, local *isolatedstate.NATAllocation, snapshot ApplianceSnapshot, mode NATValidationMode, ) (ValidatedNAT, error)