api

package
v1.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 21, 2026 License: AGPL-3.0 Imports: 88 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package api exposes VirtoMir's HTTP/JSON API (versioned under /api/v1) and serves the web UI.

Index

Constants

View Source
const SIEMConfigFile = "siem.json"

SIEMConfigFile holds the audit forwarding settings in -state-dir.

Variables

This section is empty.

Functions

func ExternalRoleFallback added in v0.9.0

func ExternalRoleFallback(pj *project.Store) func(user string, groups []string) auth.Role

ExternalRoleFallback returns a roleFallback func for LDAP/OIDC external auth. When an external user or their directory groups belong to at least one project, they are granted auth.Member role. pj is a concrete *project.Store (safe when nil).

func RoleOfWithProjects added in v0.9.0

func RoleOfWithProjects(normal func(string) auth.Role, pj *project.Store, groupsOf func(string) []string) func(string) auth.Role

RoleOfWithProjects builds a roleOf function that falls back to auth.Member if the normal role is NoAccess and the user belongs to at least one project.

Types

type BGPView added in v1.0.0

type BGPView struct {
	Config   physnet.BGPConfig    `json:"config"`
	FRR      physnet.FRRStatus    `json:"frr"`
	Sessions []physnet.BGPSession `json:"sessions"`
	Error    string               `json:"error,omitempty"`
}

BGPView is this host's BGP settings (passwords left out) with FRR's state.

type BMCLink struct {
	Driver string `json:"driver"` // ipmi, redfish
	URL    string `json:"url"`
}

type Backend

type Backend interface {
	HostInfo() (virt.HostInfo, error)
	ListDomains() ([]virt.Domain, error)
	DomainDetail(uuid string) (virt.DomainDetail, error)
	DomainXML(uuid string, inactive bool) (string, error)
	DomainAction(uuid string, action virt.Action) error

	CreateDomain(spec virt.CreateSpec) (virt.CreateResult, error)
	DefineXML(uuid, xml string) (virt.DefineResult, error)
	SetAutostart(uuid string, on bool) error
	Rename(uuid, name string) error
	Delete(uuid string, removeStorage bool) (virt.DeleteResult, error)
	Clone(ctx context.Context, uuid, name string, report func(string)) (string, error)

	ChangeMedia(uuid, target, source string) error
	AttachDisk(uuid string, spec virt.DiskSpec) (string, error)
	AttachInterface(uuid string, spec virt.NICSpec) error
	DetachDevice(uuid string, ref virt.DeviceRef) (virt.DeviceResult, error)

	ListSnapshots(uuid string) ([]virt.Snapshot, error)
	CreateSnapshot(uuid string, spec virt.SnapshotSpec) (string, error)
	RevertSnapshot(uuid, name string, safety bool) (virt.RevertResult, error)
	DeleteSnapshot(uuid, name string) error

	ListPools() ([]virt.Pool, error)
	CreatePool(spec virt.PoolSpec) error
	DeletePool(name string) error
	PoolAction(name, action string) error
	SetPoolAutostart(name string, on bool) error
	ListVolumes(pool string) ([]virt.Volume, error)
	CreateVolume(pool string, spec virt.VolumeSpec) (virt.Volume, error)
	DeleteVolume(pool, name string) error
	UploadVolume(ctx context.Context, pool, name string, size int64, r io.Reader) (virt.Volume, error)

	ListNetworks() ([]virt.VNetwork, error)
	CreateNetwork(spec virt.NetworkSpec) error
	DeleteNetwork(name string) error
	NetworkAction(name, action string) error
	SetNetworkAutostart(name string, on bool) error
	NetworkLeases(name string) ([]virt.Lease, error)

	GetSettings(uuid string) (virt.SettingsView, error)
	PreviewSettings(uuid string, s virt.Settings) (virt.Preview, error)
	SaveSettings(uuid string, s virt.Settings) (virt.SaveResult, error)
	ResizeDisk(uuid, target string, sizeGiB uint64) error
	SetDiskQoS(uuid, target string, qos virt.DiskIoTune) error
	ResizeVolume(pool, name string, sizeGiB uint64) error
	AddDHCPHost(network string, h virt.DHCPHost) error
	DeleteDHCPHost(network, mac string) error
}

Backend is what the API needs from the virtualization layer (implemented by *virt.Client).

type Backupper

type Backupper interface {
	ListBackups(dir virt.BackupDir, uuid string) ([]virt.Backup, error)
	BackupDomain(ctx context.Context, dir virt.BackupDir, uuid string, opts virt.BackupOptions, report func(string)) (virt.Backup, error)
	DeleteBackup(dir virt.BackupDir, id string) error
	RestoreBackup(ctx context.Context, dir virt.BackupDir, id, name, pool string, force bool, report func(string)) (string, error)
	VerifyBackup(ctx context.Context, dir virt.BackupDir, id string, report func(string)) (virt.Backup, error)
}

Backupper is the backup part of the backend (implemented by *virt.Client).

type BandwidthSetter added in v1.0.0

type BandwidthSetter interface {
	SetInterfaceBandwidth(uuid, mac string, bw virt.NICBandwidth) error
}

BandwidthSetter limits a network adapter's traffic.

type CephHostView added in v1.0.0

type CephHostView struct {
	ceph.CephHost
	MemberID string `json:"memberId,omitempty"`
}

CephHostView is a Ceph host with the cluster member it is, if any.

type CephManager added in v1.0.0

type CephManager struct {
	ID   string `json:"id"`
	Name string `json:"name"`
	FSID string `json:"fsid"`
}

CephManager is the member that manages the cluster.

type CephPoolView added in v1.0.0

type CephPoolView struct {
	ceph.PoolDetail
	LibvirtPool string `json:"libvirtPool,omitempty"`
}

CephPoolView is an RBD pool and the libvirt pool that uses it here.

type CephStatus added in v1.0.0

type CephStatus struct {
	// Installed: the ceph command is here; Cephadm: so is cephadm (needed to bootstrap).
	Installed bool `json:"installed"`
	Cephadm   bool `json:"cephadm"`
	// Managed: this host manages a cluster; ManagedBy names the member that does when
	// another one does.
	Managed   bool                `json:"managed"`
	ManagedBy *CephManager        `json:"managedBy,omitempty"`
	Config    *ceph.ClusterConfig `json:"config,omitempty"`
	Telemetry *ceph.Telemetry     `json:"telemetry,omitempty"`
	Error     string              `json:"error,omitempty"`
}

CephStatus is what GET /api/v1/ceph/status answers.

type ChassisView

type ChassisView struct {
	hostinfo.Chassis
	BMC *BMCLink `json:"bmc,omitempty"`
}

ChassisView is the chassis plus how to reach the host's management controller (BMC), if one is configured for fencing (HA): that is the only BMC address VirtoMir knows for sure.

type ClusterDomainSummary added in v0.7.0

type ClusterDomainSummary struct {
	virt.Domain
	HostID   string `json:"hostId"`
	HostName string `json:"hostName"`
}

ClusterDomainSummary is a domain with its physical host information for the unified view.

type ClusterGPU added in v1.0.0

type ClusterGPU struct {
	hostinfo.GPU
	HostID   string   `json:"hostId"`
	HostName string   `json:"hostName"`
	Pools    []string `json:"pools"`
}

ClusterGPU is a GPU with the member it sits in and the pools it belongs to.

type ComplianceSummary added in v0.9.0

type ComplianceSummary struct {
	Score        int                 `json:"score"`
	TotalChecks  int                 `json:"totalChecks"`
	PassedCount  int                 `json:"passedCount"`
	FailedCount  int                 `json:"failedCount"`
	WarningCount int                 `json:"warningCount"`
	FIPS         compliance.FIPSInfo `json:"fips"`
	AuditValid   bool                `json:"auditValid"`
}

ComplianceSummary summarizes the host's compliance posture, FIPS state, and audit log health.

type ConnectionStorer added in v0.9.0

type ConnectionStorer interface {
	Config() vmware.Connection
	SetConfig(c vmware.Connection) error
	Connection() vmware.Connection
}

ConnectionStorer holds the connection settings to vCenter or an ESXi host (ADR-0061).

type Consoler

type Consoler interface {
	ConsoleInfo(uuid string) (virt.ConsoleInfo, error)
	DialVNC(ctx context.Context, uuid string) (net.Conn, error)
	DialVNCHead(ctx context.Context, uuid string, head int) (net.Conn, error)
	SerialConsole(ctx context.Context, uuid, device string, in io.Reader, out io.Writer) error
}

Consoler is the console part of the backend (implemented by *virt.Client).

type ContentItemSummary added in v0.9.0

type ContentItemSummary struct {
	content.Item
	VersionCount  int                  `json:"versionCount"`
	LatestVersion *content.ItemVersion `json:"latestVersion,omitempty"`
	SyncStatus    string               `json:"syncStatus"` // ready, syncing, missing
}

ContentItemSummary enriches a catalog item with version metadata and local host sync state.

type Converter added in v0.9.0

type Converter interface {
	Preflighter
	VMConverter
}

Converter combines preflight checks and VM conversion.

type DRFailoverRunner added in v1.0.0

type DRFailoverRunner interface {
	ExecuteRealFailover(ctx context.Context, planID string, opts dr.FailoverOpts, report func(dr.StepLog)) (dr.ExecutionRun, error)
	ExecuteFailback(ctx context.Context, planID string, report func(dr.StepLog)) (dr.ExecutionRun, error)
	SyncGroup(ctx context.Context, groupID string) (time.Time, error)
}

DRFailoverRunner executes real disaster failover and failback, plus on-demand group sync (implemented by *dr.FailoverEngine).

type DROrchestrator added in v1.0.0

type DROrchestrator interface {
	ExecuteTestFailover(ctx context.Context, planID string, report func(dr.StepLog)) (dr.ExecutionRun, error)
	ExecuteTestCleanup(ctx context.Context, planID, runID string, report func(dr.StepLog)) (dr.ExecutionRun, error)
	GetDiskMappings(ctx context.Context, group dr.ProtectionGroup) ([]dr.VMDiskMapping, error)
}

DROrchestrator runs DR test-failover and test-cleanup operations (implemented by *dr.Orchestrator).

type DRStorer added in v1.0.0

type DRStorer interface {
	ListProtectionGroups() []dr.ProtectionGroup
	GetProtectionGroup(id string) (dr.ProtectionGroup, bool)
	CreateProtectionGroup(g dr.ProtectionGroup) (dr.ProtectionGroup, error)
	UpdateProtectionGroup(g dr.ProtectionGroup) error
	DeleteProtectionGroup(id string) error
	ListPlans(protectionGroupID string) []dr.RecoveryPlan
	GetPlan(id string) (dr.RecoveryPlan, bool)
	CreatePlan(p dr.RecoveryPlan) (dr.RecoveryPlan, error)
	UpdatePlan(p dr.RecoveryPlan) error
	DeletePlan(id string) error
	ListRuns(planID string) []dr.ExecutionRun
	GetRun(id string) (dr.ExecutionRun, bool)
}

DRStorer holds the persistent DR configuration: protection groups, recovery plans and execution-run history (implemented by *dr.Store).

type DiskMover added in v1.0.0

type DiskMover interface {
	MoveDisk(ctx context.Context, uuid, target, pool string, report func(string)) error
}

DiskMover moves a machine's disk into another storage pool on the same host.

type DiskSizer added in v0.6.0

type DiskSizer interface {
	DiskBytes(uuids []string) (map[string]uint64, error)
}

DiskSizer reports the size of machines' own disks for the disk quota (ADR-0044).

type DiskSparsifier added in v1.0.0

type DiskSparsifier interface {
	SparsifyDisk(ctx context.Context, uuid, target string, report func(string)) (uint64, error)
}

DiskSparsifier compacts a stopped machine's disk image.

type ExtraDevicer

type ExtraDevicer interface {
	AddDevice(uuid string, spec virt.DeviceSpec) (virt.DeviceResult, error)
	GetQEMUArgs(uuid string) (virt.QEMUArgs, error)
	SetQEMUArgs(uuid string, q virt.QEMUArgs) (virt.DefineResult, error)
	CreateMDev(spec virt.MDevSpec) (string, error)
	DeleteMDev(uuid string) error
}

ExtraDevicer adds watchdogs, TPMs, shared folders, vGPU slices and the like, edits the QEMU command line and manages the host's mediated devices (implemented by *virt.Client). All writes are admin-only (requiredRole's default) and stay out of operator self-service: shared folders, mdevs and QEMU arguments reach past the host's safety checks.

type Firewaller

type Firewaller interface {
	Firewall(uuid string) (virt.Firewall, error)
	SetFirewall(uuid string, fw virt.Firewall) (virt.FirewallResult, error)
	RemoveFirewall(uuid string) error
}

Firewaller manages a machine's firewall (implemented by *virt.Client, ADR-0033).

type Flattener added in v1.0.0

type Flattener interface {
	FlatCopy(ctx context.Context, dir virt.BackupDir, id string, report func(string)) (string, func(), error)
}

Flattener merges an incremental backup's chain for an off-site copy (*virt.Client).

type GPUPoolView added in v1.0.0

type GPUPoolView struct {
	gpool.Pool
	Hosts []gpool.GPUResource `json:"hosts"`
	Total int                 `json:"total"`
	Used  int                 `json:"used"`
	Free  int                 `json:"free"`
}

GPUPoolView is a pool with what the cluster has of it.

type GPURequest added in v1.0.0

type GPURequest struct {
	Pool  string `json:"pool"`
	Count int    `json:"count"`
}

GPURequest is the GPUs a new machine asks for.

type GuestAgent added in v1.0.0

type GuestAgent interface {
	GuestInfo(uuid string) (virt.GuestInfo, error)
	SetGuestPassword(uuid, user, password string) error
}

GuestAgent talks to the guest agent inside a running machine.

type GuestExecer added in v1.0.0

type GuestExecer interface {
	GuestExec(ctx context.Context, uuid string, argv []string) (virt.GuestExecResult, error)
}

GuestExecer runs a program inside a running machine through its guest agent.

type HistoryQuerier

type HistoryQuerier interface {
	Query(names []string, rng time.Duration, now time.Time) (history.Result, error)
}

HistoryQuerier answers history queries (implemented by *history.Store).

type HostDevicer

type HostDevicer interface {
	HostHardware() (virt.HostHardware, error)
	AttachHostdev(uuid string, spec virt.HostdevSpec) (string, error)
}

HostDevicer lists host hardware and passes devices to machines (implemented by *virt.Client).

type HostResult

type HostResult struct {
	Host  string `json:"host"`
	OK    bool   `json:"ok"`
	Error string `json:"error,omitempty"`
}

HostResult is the outcome of one step of a cluster-wide action on one member.

type IPRequest added in v1.0.0

type IPRequest struct {
	Pool string `json:"pool"`
	IP   string `json:"ip,omitempty"` // "" = the first free one
}

IPRequest asks for a fixed address of an IP pool for a new machine (ADR-0075).

type InventoryLister added in v0.9.0

type InventoryLister interface {
	List(ctx context.Context, c vmware.Connection) (vmware.Inventory, error)
}

InventoryLister reads the VMware inventory over a connection.

type Live

type Live interface {
	Subscribe() (backlog [][]byte, updates <-chan []byte, unsubscribe func())
	Refresh()
}

Live is the snapshot stream (implemented by *live.Hub).

type MemberStatus

type MemberStatus struct {
	ID          string `json:"id"`
	Name        string `json:"name"`
	Address     string `json:"address"`
	Fingerprint string `json:"fingerprint"`
	Self        bool   `json:"self"`
	Reachable   bool   `json:"reachable"`
	Version     string `json:"version,omitempty"`
	Error       string `json:"error,omitempty"`
}

MemberStatus is a member as the UI sees it: reachable now, which version it runs.

type Migrator

type Migrator interface {
	PlanMigration(uuid string) (virt.MigrationSource, error)
	CheckPaths(paths []string) ([]virt.PathCheck, error)
	MigrateBegin(uuid string, flags libvirt.DomainMigrateFlags, disks []string) ([]byte, string, error)
	MigratePrepare(name, xml, uri string, cookie []byte, flags libvirt.DomainMigrateFlags, disks []string) ([]byte, string, error)
	MigratePerform(ctx context.Context, uuid, uri string, cookie []byte, flags libvirt.DomainMigrateFlags, disks []string, progress func(string)) ([]byte, error)
	MigrateFinish(name, uri string, cookie []byte, flags libvirt.DomainMigrateFlags, disks []string, cancelled bool) ([]byte, error)
	MigrateConfirm(uuid string, cookie []byte, flags libvirt.DomainMigrateFlags, disks []string, cancelled bool) error
	RemoveImage(path string) error
	HostCPU() (virt.HostCPU, error)
}

Migrator is the live-migration part of the backend (implemented by *virt.Client).

type Mover

type Mover interface {
	PlanMove(uuid string) (virt.MovePlan, error)
	AdoptDomain(xml string) (string, error)
}

Mover is the part of the backend that moves machines between hosts (ADR-0020).

type OVAImporter

type OVAImporter interface {
	ImportOVA(ctx context.Context, pool, name string, r io.Reader, report func(string)) (virt.CreateResult, error)
}

OVAImporter turns an OVA appliance into a machine (implemented by *virt.Client).

type ObjectXMLer added in v0.5.0

type ObjectXMLer interface {
	NetworkXML(name string) (string, error)
	DefineNetworkXML(name, doc string) (virt.ObjectSaveResult, error)
	PoolXML(name string) (string, error)
	DefinePoolXML(name, doc string) (virt.ObjectSaveResult, error)
}

ObjectXMLer reads and redefines networks and storage pools as raw XML (implemented by *virt.Client). P4: every libvirt setting is reachable, not only what the forms offer.

type Options

type Options struct {
	Backend Backend
	Live    Live
	Jobs    *jobs.Manager
	// Auth nil means no sign-in (development only; virtomird warns loudly).
	Auth    *auth.Manager
	UI      fs.FS // nil: no UI bundled
	Version string
	Log     *slog.Logger
	// History nil: no metric history (GET /api/v1/history answers 404).
	History HistoryQuerier
	// Tokens nil: no API tokens. Activity nil: changes are only logged, not kept.
	Tokens   *auth.Tokens
	Activity *activity.Log
	// Alerts nil: no alert engine. Schedules nil: no schedules and no backups.
	Alerts    *alerts.Engine
	Schedules *schedule.Scheduler
	// Cluster nil: this host cannot join others (no TLS). Fingerprint is this host's TLS
	// certificate, HostName how members call it, ListenPort where it listens (ADR-0020).
	// Quotas nil: only admins create machines. GroupsOf names a user's groups for group
	// rules (default: the Linux groups).
	Quotas   *quota.Store
	GroupsOf func(user string) []string
	// ConfigHistory nil: machine definitions are not versioned.
	ConfigHistory *confighist.Store
	// ConfigDrift nil: definition files edited by hand are not noticed.
	ConfigDrift *confighist.DriftWatcher
	// Timeline nil: what libvirt reports about a machine's life (started, crashed, paused)
	// is not kept; its timeline still has everything else.
	Timeline    *timeline.Store
	Cluster     *cluster.Store
	Fingerprint string
	HostName    string
	ListenPort  string

	// HA nil: no high availability (the manager is connected later with SetHA).
	HA       *ha.Store
	Reports  *reports.Store
	Respools *respool.Store
	// HostInfo nil: no chassis, sensors, GPU load, interfaces or packet capture.
	HostInfo *hostinfo.Reader
	// Updater nil: no update check. StateDir is where downloads go.
	Updater  *update.Checker
	StateDir string
	// HostNet nil: no bridges, bonds or VLAN interfaces from the UI (ADR-0042).
	HostNet *hostnet.Manager
	// Offsite nil: no off-site copies of backups (ADR-0043).
	Offsite *offsite.Store
	// VMwareStore nil: VMware migration connection store is not available (ADR-0061).
	VMwareStore ConnectionStorer
	// VMwareWaves nil: VMware migration wave registry is not available.
	VMwareWaves WaveRunner
	// VMwareLister nil: GovmomiLister is used.
	VMwareLister InventoryLister
	// VMwarePreflight nil: Converter with backend client is used.
	VMwarePreflight Preflighter
	// VMwareConverter nil: Converter with backend client is used.
	VMwareConverter VMConverter
	// DRS nil: no distributed resource scheduler.
	DRS *drs.Engine
	// Placement nil: no placement rules.
	Placement *placement.Store
	// Projects nil: no multi-tenancy (ADR-0060).
	Projects *project.Store
	// RateLimiter nil: standard token-bucket limiter (60/min) is used.
	RateLimiter *auth.RateLimiter
	// ZFSRep nil: no ZFS replication.
	ZFSRep *zfsrep.Manager
	// Catalog nil: no self-service catalog (ADR-0065). LeaseMgr nil: catalog machines
	// never expire.
	Catalog  *catalog.Store
	LeaseMgr *catalog.LeaseManager
	// FIPSInfo holds kernel FIPS mode and TLS enforcement details (ADR-0064).
	FIPSInfo compliance.FIPSInfo
	// ComplianceScanner nil: standard scanner rooted at "/" is used (ADR-0064).
	ComplianceScanner *compliance.Scanner
	// Insights nil: no operations-intelligence engine (ADR-0066).
	Insights *insights.Engine
	// Content nil: no content library (ADR-0063).
	Content     *content.Store
	ContentSync *content.SyncManager
	// DR nil: no disaster recovery (ADR-0069, -dr-experimental).
	DRStore        DRStorer
	DROrchestrator DROrchestrator
	DRFailover     DRFailoverRunner
	// GPools nil: no GPU pools (ADR-0071).
	GPools *gpool.Store
	// SDN nil: no software-defined networking on OVN (ADR-0072). SDNRunner runs ovs-vsctl,
	// ovn-nbctl and ovn-sbctl; SDNNorthbound is the OVN northbound database ("" = local).
	SDN           *sdn.Store
	SDNRunner     sdn.Runner
	SDNNorthbound string
	// LCM nil: no rolling cluster upgrades (ADR-0070).
	LCM *lcm.Store
	// Upgrader nil: no OS package upgrades from VirtoMir.
	Upgrader SystemUpgrader
	// Ceph nil: no hyper-converged Ceph or storage policies (ADR-0073); CephRunner runs
	// cephadm, ceph, rbd and lsblk.
	Ceph       *ceph.Store
	CephRunner ceph.Runner
	// StorageEff nil: no storage efficiency, tiers or NVMe/TCP (ADR-0074); EffRunner runs
	// zfs, zpool and nvme.
	StorageEff *storageeff.Store
	EffRunner  storageeff.Runner
	// Physnet nil: no SR-IOV, BGP, IP pools or dynamic DNS (ADR-0075); PhysRunner runs
	// vtysh, SRIOV reads the host's sysfs (physnet.Host when zero).
	Physnet    *physnet.Store
	PhysRunner physnet.Runner
	SRIOV      physnet.SRIOV
	// K8s nil: no Kubernetes clusters (ADR-0076).
	K8s *k8s.Store
	// Baremetal nil: no bare-metal onboarding (ADR-0077); BMRunner runs systemd-run and
	// systemctl for proxy DHCP.
	Baremetal *baremetal.Store
	BMRunner  baremetal.Runner
}

type Overlay added in v1.0.0

type Overlay struct {
	Name string `json:"name"`
	VNI  uint   `json:"vni"`
}

Overlay is a cluster-wide VXLAN network.

type Placer added in v0.5.0

type Placer interface {
	Placements() ([]virt.Placement, error)
}

Placer reports where running machines' vCPUs sit (for the topology view).

type PoolEfficiency added in v1.0.0

type PoolEfficiency struct {
	Pool string                    `json:"pool"`
	Kind string                    `json:"kind"` // zfs, ceph or none
	ZFS  *storageeff.ZFSEfficiency `json:"zfs,omitempty"`
	Ceph *ceph.PoolDetail          `json:"ceph,omitempty"`
	Note string                    `json:"note,omitempty"`
}

PoolEfficiency is what a pool saves: ZFS compression/dedup, or Ceph compression when this host manages the cluster; Kind "none" for pools without either.

type PoolView

type PoolView struct {
	respool.ResourcePool
	Usage respool.Usage `json:"usage"`
}

PoolView is a pool with what its machines use.

type Preflighter added in v0.9.0

type Preflighter interface {
	Preflight(ctx context.Context, c vmware.Connection, vm vmware.VM, poolFreeBytes uint64) error
}

Preflighter checks conditions before migration starts.

type ReconcileResult added in v1.0.0

type ReconcileResult struct {
	Applied int      `json:"applied"`
	Errors  []string `json:"errors"`
}

ReconcileResult names what OVN refused.

type SDNStatus added in v1.0.0

type SDNStatus struct {
	Host         sdn.HostStatus    `json:"host"`
	Chassis      []sdn.ChassisInfo `json:"chassis"`
	ChassisError string            `json:"chassisError,omitempty"`
}

SDNStatus is this host's OVN and the overlay's chassis.

type Server

type Server struct {
	// contains filtered or unexported fields
}

func NewServer

func NewServer(o Options) *Server

func (*Server) FIPSInfo added in v0.9.0

func (s *Server) FIPSInfo() compliance.FIPSInfo

FIPSInfo returns the FIPS cryptographic posture and TLS restriction details.

func (*Server) HATransport

func (s *Server) HATransport() ha.Transport

HATransport is how the HA manager reaches the other members: over the pinned peer links.

func (*Server) Handler

func (s *Server) Handler() http.Handler

func (*Server) PeerFor added in v0.9.0

func (s *Server) PeerFor(hostID string) (*cluster.Peer, bool)

PeerFor resolves a host ID or node name to an active cluster peer connection.

func (*Server) RunBaremetal added in v1.0.0

func (s *Server) RunBaremetal(ctx context.Context)

RunBaremetal is called once before the API serves: it starts the boot file server.

func (*Server) RunDRRPO added in v1.0.0

func (s *Server) RunDRRPO(ctx context.Context)

RunDRRPO checks DR RPO compliance every 60 seconds, posting notice (through the alert channels) when a protection group falls behind its RPO target.

func (*Server) RunDRS added in v0.8.0

func (s *Server) RunDRS(ctx context.Context)

RunDRS carries out recommendations by itself while DRS is fully automated (ADR-0057). Each member acts only for the machines it runs, one live migration at a time, so members never move the same machine twice; the overloaded host sheds its own load.

func (*Server) RunK8s added in v1.0.0

func (s *Server) RunK8s(ctx context.Context)

RunK8s is called once before the API serves: operations cut off by a restart are marked failed, deletions continue.

func (*Server) RunLCM added in v1.0.0

func (s *Server) RunLCM(ctx context.Context)

RunLCM is called once before the API serves: it continues, in the background, a plan this host was running when it restarted (it upgrades itself last, so it restarts in the middle of its own plan).

func (*Server) RunReportSchedules

func (s *Server) RunReportSchedules(ctx context.Context)

RunReportSchedules makes this host's scheduled reports until ctx ends. Schedules are kept per host, but every report covers the whole cluster, so one host's schedules are enough.

func (*Server) RunWifiBridges added in v1.2.0

func (s *Server) RunWifiBridges(ctx context.Context)

RunWifiBridges brings back the Wi-Fi bridges after a restart or a reboot, and starts their networks (libvirt could not at boot: the bridge was not there yet).

func (*Server) SetHA

func (s *Server) SetHA(m *ha.Manager)

SetHA connects the HA manager (it needs the server as its transport, so it comes later).

func (*Server) SyncMembers

func (s *Server) SyncMembers(ctx context.Context)

SyncMembers pulls the member list from every peer and keeps the newest; run it now and then so a host that was down during a change catches up. A host that every other member refuses was removed while it was away: it becomes standalone.

type SetupCheck added in v0.6.0

type SetupCheck struct {
	ID     string `json:"id"`
	OK     bool   `json:"ok"`
	Needed bool   `json:"needed"` // without it, machines cannot work (otherwise: recommended)
	Title  string `json:"title"`
	Detail string `json:"detail"`
}

SetupCheck is one thing the host needs, or should have.

type SharedState added in v1.0.0

type SharedState struct {
	DRS       *drs.Config             `json:"drs,omitempty"`
	Placement *placement.Shared       `json:"placement,omitempty"`
	GPUPools  *gpool.Shared           `json:"gpuPools,omitempty"`
	SDN       *sdn.Shared             `json:"sdn,omitempty"`
	Policies  *ceph.PoliciesShared    `json:"storagePolicies,omitempty"`
	Tiers     *storageeff.TiersShared `json:"storageTiers,omitempty"`
	Physnet   *physnet.Shared         `json:"physnet,omitempty"`
	Overlays  []Overlay               `json:"overlays"`
}

SharedState is what /api/v1/cluster/peer/shared answers.

type Spicer added in v0.6.0

type Spicer interface {
	DialSPICE(ctx context.Context, uuid string) (net.Conn, error)
	SetDisplay(uuid, protocol string) error
}

Spicer is the SPICE part of the backend (ADR-0046); a backend without it keeps VNC and the serial console.

type SystemUpgrader added in v1.0.0

type SystemUpgrader interface {
	Upgrade(ctx context.Context, reboot bool) (string, error)
}

SystemUpgrader upgrades this host's OS packages (*systemd.Upgrader).

type Templater

type Templater interface {
	SetTemplate(uuid string, on bool) error
	Deploy(ctx context.Context, template string, spec virt.DeploySpec, report func(string)) (string, error)
}

Templater is the template part of the backend (implemented by *virt.Client).

type VMConverter added in v0.9.0

type VMConverter interface {
	Convert(ctx context.Context, c vmware.Connection, vm vmware.VM, opts vmware.ConvertOpts, report func(string)) (string, error)
}

VMConverter migrates one VMware VM and defines it in VirtoMir.

type VPCDetail added in v1.0.0

type VPCDetail struct {
	sdn.VPC
	Router  sdn.Router           `json:"router"`
	Gateway *sdn.ExternalGateway `json:"gateway,omitempty"`
}

VPCDetail is a VPC with its router and gateway.

type VXLANPeerSetter added in v1.0.0

type VXLANPeerSetter interface {
	SetVXLANPeers(name string, peers []string) error
}

VXLANPeerSetter is the backend side of keeping a cluster overlay's peers current.

type WaveRunner added in v0.9.0

type WaveRunner interface {
	Start(ctx context.Context, conn vmware.Connection, vmIDs []string, parallel int, conv vmware.OneConverter, report func(string)) (vmware.Wave, error)
	Retry(ctx context.Context, waveID string, conv vmware.OneConverter, report func(string)) (vmware.Wave, error)
	Get(id string) (vmware.Wave, bool)
	List() []vmware.Wave
}

WaveRunner manages batches of VM conversions executed concurrently.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL