Documentation
¶
Index ¶
- Constants
- func CertEncodeToPEM(rawCert []byte) string
- func ValidNICType(s string) error
- func X509CertEncodeToPEM(cert *x509.Certificate) string
- type Artifact
- type ArtifactPost
- type ArtifactPut
- type ArtifactType
- type Batch
- type BatchConfig
- type BatchConstraint
- type BatchDefaults
- type BatchPlacement
- type BatchPut
- type BatchStatusType
- type Certificate
- type ExternalConnectivityStatus
- type IncusNICType
- type IncusProperties
- type Instance
- type InstanceOverride
- type InstanceProperties
- type InstancePropertiesConfigurable
- type InstancePropertiesDisk
- type InstancePropertiesNIC
- type InstancePropertiesSnapshot
- type InstanceRestrictionOverride
- type MigrationNetworkPlacement
- type MigrationStatusType
- type MigrationWindow
- type MigrationWindowConfig
- type Network
- type NetworkPlacement
- type NetworkType
- type OSType
- type Placement
- type QueueEntry
- type ServerPut
- type ServerUntrusted
- type Source
- type SourcePut
- type SourceType
- type SystemCertificatePost
- type SystemConfig
- type SystemNetwork
- type SystemSecurity
- type SystemSecurityOIDC
- type SystemSecurityOpenFGA
- type SystemSettings
- type Target
- type TargetPut
- type TargetType
- type VMwareProperties
- type Warning
- type WarningPut
- type WarningScope
- type WarningStatus
- type WarningType
- type WorkerCommand
- type WorkerCommandType
- type WorkerResponse
- type WorkerResponseType
Constants ¶
const ( DefaultTarget = "default" DefaultTargetProject = "default" DefaultStoragePool = "default" )
const ( APIVersion string = "1.0" APIStatus string = "devel" )
Variables ¶
This section is empty.
Functions ¶
func CertEncodeToPEM ¶
func ValidNICType ¶
func X509CertEncodeToPEM ¶
func X509CertEncodeToPEM(cert *x509.Certificate) string
Types ¶
type Artifact ¶
type Artifact struct {
ArtifactPost `yaml:",inline"`
// Unique identifier of an artifact.
// Example: 400f6ceb-659a-4b3c-8598-0bc9d20eafe3
UUID uuid.UUID `json:"uuid" yaml:"uuid"`
// Record of the last change to an artifact's properties or resources.
// Example: 2025-01-01 01:00:00
LastUpdated time.Time `json:"last_updated" yaml:"last_updated"`
// List of filenames uploaded as resources.
// Example: vmware-sdk.tar.gz
Files []string `json:"files" yaml:"files"`
}
Artifact represents external resources uploaded to Migration Manager.
swagger:model
func (Artifact) DefaultArtifactFile ¶
DefaultArtifactFile returns the default file name expected for a given artifact parent (OS name or source type).
type ArtifactPost ¶
type ArtifactPost struct {
ArtifactPut `yaml:",inline"`
// Type of the artifact.
// Example: sdk
Type ArtifactType `json:"type" yaml:"type"`
}
ArtifactPost represents the properties of an artifact to be registered in Migration Manager.
swagger:model
type ArtifactPut ¶
type ArtifactPut struct {
// Description of the artifact.
// Example: VMware disklib tarball
Description string `json:"description,omitempty" yaml:"description,omitempty"`
// OS name that the artifact relates to.
// Example: windows
OS OSType `json:"os,omitempty" yaml:"os,omitempty"`
// Architectures used to match VMs to an artifact.
// Example: x86_64
Architectures []string `json:"architectures,omitempty" yaml:"architectures,omitempty"`
// Versions used to match VMs to an artifact.
// Example: 1.0
Versions []string `json:"versions,omitempty" yaml:"versions,omitempty"`
// Source type that the artifact relates to.
// Example: vmware
SourceType SourceType `json:"source_type,omitempty" yaml:"source_type,omitempty"`
}
ArtifactPut represents the configurable properties of an artifact record.
swagger:model
type ArtifactType ¶
type ArtifactType string
const ( ARTIFACTTYPE_SDK ArtifactType = "sdk" ARTIFACTTYPE_OSIMAGE ArtifactType = "os-image" ARTIFACTTYPE_DRIVER ArtifactType = "driver" )
type Batch ¶
type Batch struct {
BatchPut `yaml:",inline"`
// The status of this batch
// Example: BATCHSTATUS_DEFINED
Status BatchStatusType `json:"status" yaml:"status"`
// A free-form string to provide additional information about the status
// Example: "4 of 5 instances migrated"
StatusMessage string `json:"status_message" yaml:"status_message"`
// Time in UTC when the batch was started.
// Example: 2025-01-01 01:00:00
StartDate time.Time `json:"start_date" yaml:"start_date"`
}
Batch defines a collection of Instances to be migrated, possibly during a specific window of time.
swagger:model
type BatchConfig ¶
type BatchConfig struct {
// Whether to re-run scriptlets if a migration restarts
RerunScriptlets bool `json:"rerun_scriptlets" yaml:"rerun_scriptlets"`
// The placement scriptlet used to determine the target for queued instances.
// Example: starlark scriptlet
PlacementScriptlet string `json:"placement_scriptlet" yaml:"placement_scriptlet"`
// PostMigrationRetries is the maximum number of times post-migration steps will be retried upon errors.
// Example: 5
PostMigrationRetries int `json:"post_migration_retries" yaml:"post_migration_retries"`
// Overrides to allow migrating instances that are otherwise restricted.
RestrictionOverrides InstanceRestrictionOverride `json:"instance_restriction_overrides" yaml:"instance_restriction_overrides"`
// Interval over which background sync will be rerun until the migration window has begun.
BackgroundSyncInterval string `json:"background_sync_interval" yaml:"background_sync_interval"`
// The minimum amount of time before the migration window begins that background sync can be re-attempted.
FinalBackgroundSyncLimit string `json:"final_background_sync_limit" yaml:"final_background_sync_limit"`
}
type BatchConstraint ¶
type BatchConstraint struct {
// Name of the constraint.
Name string `json:"name" yaml:"name"`
// Description of the constraint.
Description string `json:"description" yaml:"description"`
// Expression used to select instances for the constraint.
IncludeExpression string `json:"include_expression" yaml:"include_expression"`
// Maximum amount of matched instances that can concurrently migrate, before moving to the next migration window.
MaxConcurrentInstances int `json:"max_concurrent_instances" yaml:"max_concurrent_instances"`
// Minimum amount of time required for an instance to boot after initial disk import. Migration window duration must be at least this much.
MinInstanceBootTime string `json:"min_instance_boot_time" yaml:"min_instance_boot_time"`
}
BatchConstraint is a constraint to be applied to a batch to determine which instances can be migrated.
type BatchDefaults ¶
type BatchDefaults struct {
// Default target placement for instances. Can be overridden with the placement scriptlet.
Placement BatchPlacement `json:"placement" yaml:"placement"`
// Network configuration to use during migration of the instance. If unspecified, the default network configuration in the default profile will be used.
MigrationNetwork []MigrationNetworkPlacement `json:"migration_network" yaml:"migration_network"`
}
type BatchPlacement ¶
type BatchPlacement struct {
// The destination target name to be used by all instances in this batch
// Example: Mytarget
Target string `json:"target" yaml:"target"`
// The target project to use
// Example: default
TargetProject string `json:"target_project" yaml:"target_project"`
// The Incus storage pool that this batch should use for creating VMs and mounting ISO images
// Example: local
StoragePool string `json:"storage_pool" yaml:"storage_pool"`
}
type BatchPut ¶
type BatchPut struct {
// A human-friendly name for this batch
// Example: MyBatch
Name string `json:"name" yaml:"name"`
// A Expression used to select instances to add to this batch
// Language reference: https://expr-lang.org/docs/language-definition
// Example: location matches "^foobar/.*"
IncludeExpression string `json:"include_expression" yaml:"include_expression"`
// Set of migration window timings.
MigrationWindows []MigrationWindow `json:"migration_windows" yaml:"migration_windows"`
// Set of constraints to apply to the batch. For each instance, the last constraint in the list that matches will be applied.
Constraints []BatchConstraint `json:"constraints" yaml:"constraints"`
// Default configurations for the batch.
Defaults BatchDefaults `json:"defaults" yaml:"defaults"`
// Additional configuration for the batch.
Config BatchConfig `json:"config" yaml:"config"`
}
BatchPut defines the configurable fields of Batch.
swagger:model
type BatchStatusType ¶
type BatchStatusType string
const ( BATCHSTATUS_DEFINED BatchStatusType = "Defined" BATCHSTATUS_RUNNING BatchStatusType = "Running" BATCHSTATUS_STOPPED BatchStatusType = "Stopped" BATCHSTATUS_FINISHED BatchStatusType = "Finished" BATCHSTATUS_ERROR BatchStatusType = "Error" )
func (BatchStatusType) Validate ¶
func (b BatchStatusType) Validate() error
Validate ensures the BatchStatusType is valid.
type Certificate ¶
type Certificate struct {
*x509.Certificate
}
func (Certificate) MarshalJSON ¶
func (c Certificate) MarshalJSON() ([]byte, error)
func (Certificate) MarshalYAML ¶
func (c Certificate) MarshalYAML() (any, error)
func (Certificate) String ¶
func (c Certificate) String() string
func (*Certificate) UnmarshalJSON ¶
func (c *Certificate) UnmarshalJSON(b []byte) error
func (*Certificate) UnmarshalYAML ¶
func (c *Certificate) UnmarshalYAML(unmarshal func(v any) error) error
type ExternalConnectivityStatus ¶
type ExternalConnectivityStatus string
const ( EXTERNALCONNECTIVITYSTATUS_UNKNOWN ExternalConnectivityStatus = "Unknown" EXTERNALCONNECTIVITYSTATUS_OK ExternalConnectivityStatus = "OK" EXTERNALCONNECTIVITYSTATUS_CANNOT_CONNECT ExternalConnectivityStatus = "Cannot connect" EXTERNALCONNECTIVITYSTATUS_TLS_ERROR ExternalConnectivityStatus = "TLS error" EXTERNALCONNECTIVITYSTATUS_TLS_CONFIRM_FINGERPRINT ExternalConnectivityStatus = "Confirm TLS fingerprint" EXTERNALCONNECTIVITYSTATUS_AUTH_ERROR ExternalConnectivityStatus = "Authentication error" EXTERNALCONNECTIVITYSTATUS_WAITING_OIDC ExternalConnectivityStatus = "Waiting for OIDC authentications" )
func MapExternalConnectivityStatusToStatus ¶
func MapExternalConnectivityStatusToStatus(err error) ExternalConnectivityStatus
type IncusNICType ¶
type IncusNICType string
const ( INCUSNICTYPE_BRIDGED IncusNICType = "bridged" INCUSNICTYPE_MANAGED IncusNICType = "managed" )
type IncusProperties ¶
type IncusProperties struct {
// Hostname or IP address of the target endpoint
// Example: https://incus.local:6443
Endpoint string `json:"endpoint" yaml:"endpoint"`
// Store the expected target's TLS certificate, in raw bytes. Useful in situations when TLS certificate validation fails, such as when using self-signed certificates.
ServerCertificate []byte `json:"trusted_server_certificate,omitempty" yaml:"trusted_server_certificate,omitempty"`
// If set and the fingerprint matches that of the ServerCertificate, enables use of that certificate when performing TLS handshake.
// Example: b51b3046a03164a2ca279222744b12fe0878a8c12311c88fad427f4e03eca42d
TrustedServerCertificateFingerprint string `json:"trusted_server_certificate_fingerprint,omitempty" yaml:"trusted_server_certificate_fingerprint,omitempty"`
// base64-encoded TLS client key for authentication
TLSClientKey string `json:"tls_client_key,omitempty" yaml:"tls_client_key,omitempty"`
// base64-encoded TLS client certificate for authentication
TLSClientCert string `json:"tls_client_cert,omitempty" yaml:"tls_client_cert,omitempty"`
// OpenID Connect tokens
OIDCTokens *oidc.Tokens[*oidc.IDTokenClaims] `json:"oidc_tokens,omitempty" yaml:"oidc_tokens,omitempty"`
// Connectivity status of this target
ConnectivityStatus ExternalConnectivityStatus `json:"connectivity_status" yaml:"connectivity_status"`
// Maximum number of concurrent imports that can occur
// Example: 10
ImportLimit int `json:"import_limit,omitempty" yaml:"import_limit,omitempty"`
// Maximum number of concurrent instance creations that can occur
// Example: 10
CreateLimit int `json:"create_limit,omitempty" yaml:"create_limit,omitempty"`
// Timeout for establishing connections to the target.
// Example: 5m
ConnectionTimeout string `json:"connection_timeout" yaml:"connection_timeout"`
}
IncusProperties defines the set of Incus specific properties of a target that the migration manager can connect to.
type Instance ¶
type Instance struct {
// The originating source name for this instance
// Example: MySource
Source string `json:"source" yaml:"source"`
// The source type of the Instance's source.
// Example: vmware
SourceType SourceType `json:"source_type" yaml:"source_type"`
// Properties of the Instance imported from the source.
Properties InstanceProperties `json:"properties" yaml:"properties"`
// Last synced update from the source.
// Example: 2025-01-01 01:00:00
LastUpdateFromSource time.Time `json:"last_update_from_source" yaml:"last_update_from_source"`
// Overrides, if any, for this instance
Overrides InstanceOverride `json:"overrides" yaml:"overrides"`
}
Instance defines a VM instance to be migrated.
swagger:model
type InstanceOverride ¶
type InstanceOverride struct {
// The last time this instance override was updated
// Example: 2024-11-12 16:15:00 +0000 UTC
LastUpdate time.Time `json:"last_update" yaml:"last_update"`
// An optional comment about the override
// Example: "Manually tweak number of CPUs"
Comment string `json:"comment" yaml:"comment"`
// If true, migration of this instance will be disabled.
// Example: true
DisableMigration bool `json:"disable_migration" yaml:"disable_migration"`
// If true, restrictions that put the VM in a blocked state, preventing migration, will be ignored.
// Example: true
IgnoreRestrictions bool `json:"ignore_restrictions" yaml:"ignore_restrictions"`
// Overrides to properties imported from the source.
Properties InstancePropertiesConfigurable `json:"properties" yaml:"properties"`
}
InstanceOverride defines a limited set of instance values that can be overridden as part of the migration process.
swagger:model
type InstanceProperties ¶
type InstanceProperties struct {
InstancePropertiesConfigurable `yaml:",inline"`
// Unique identifier of the Instance.
// Example: a2095069-a527-4b2a-ab23-1739325dcac7
UUID uuid.UUID `json:"uuid" yaml:"uuid" expr:"uuid"`
// Location path of the Instance.
// Example: /path/to/instance_name
Location string `json:"location" yaml:"location" expr:"location"`
// Whether the Instance has secure-boot enabled.
// Example: true
SecureBoot bool `json:"secure_boot" yaml:"secure_boot" expr:"secure_boot"`
// Whether the Instance uses legacy (CSM) boot.
// Example: true
LegacyBoot bool `json:"legacy_boot" yaml:"legacy_boot" expr:"legacy_boot"`
// Whether the Instance has a TPM.
// Example: true
TPM bool `json:"tpm" yaml:"tpm" expr:"tpm"`
// Whether the Instance was running when the sync was performed.
// Example: true
Running bool `json:"running" yaml:"running" expr:"running"`
// Whether the Instance supports background-import migrations.
// Example: true
BackgroundImport bool `json:"background_import" yaml:"background_import" expr:"background_import"`
// List of network interface cards assigned to the Instance.
NICs []InstancePropertiesNIC `json:"nics" yaml:"nics" expr:"nics"`
// List of disks assigned to the Instance.
Disks []InstancePropertiesDisk `json:"disks" yaml:"disks" expr:"disks"`
// List of snapshots for the Instance.
Snapshots []InstancePropertiesSnapshot `json:"snapshots" yaml:"snapshots" expr:"snapshots"`
}
InstanceProperties are all properties supported by instances.
func (*InstanceProperties) Apply ¶
func (i *InstanceProperties) Apply(cfg InstancePropertiesConfigurable)
Apply updates the properties with the given set of configurable properties. Only non-default values will be applied.
type InstancePropertiesConfigurable ¶
type InstancePropertiesConfigurable struct {
// Name of the Instance.
// Example: myVM
Name string `json:"name" yaml:"name" expr:"name"`
// Description of the Instance.
// Example: Windows Server 2025
Description string `json:"description" yaml:"description" expr:"description"`
// Number of CPUs assigned to the Instance.
// Example: 4
CPUs int64 `json:"cpus" yaml:"cpus" expr:"cpus"`
// Memory in bytes assigned to the Instance.
// Example: 1073741824
Memory int64 `json:"memory" yaml:"memory" expr:"memory"`
// Additional configuration of the Instance.
Config map[string]string `json:"config" yaml:"config" expr:"config"`
// OS name of the Instance.
// Example: Ubuntu
OS string `json:"os" yaml:"os" expr:"os"`
// OS version of the Instance.
// Example: 24.04
OSVersion string `json:"os_version" yaml:"os_version" expr:"os_version"`
// Architecture of the Instance.
// Example: x86_64
Architecture string `json:"architecture" yaml:"architecture" expr:"architecture"`
}
InstancePropertiesConfigurable are the configurable properties of an instance.
type InstancePropertiesDisk ¶
type InstancePropertiesDisk struct {
// Capacity of the disk in bytes.
// Example: 1073741824
Capacity int64 `json:"capacity" yaml:"capacity" expr:"capacity"`
// Name of the disk and associated datastore.
// Example: [mydatastore] disk_1.vmdk
Name string `json:"name" yaml:"name" expr:"name"`
// Example: true
Shared bool `json:"shared" yaml:"shared" expr:"shared"`
// Whether the disk supports migration.
// Example: true
Supported bool `json:"supported" yaml:"supported" expr:"supported"`
}
InstancePropertiesDisk are all properties supported by instance disks.
type InstancePropertiesNIC ¶
type InstancePropertiesNIC struct {
// Unique ID identifying the NIC to a network registered in Migration Manager.
// Example: a2095069-a527-4b2a-ab23-1739325dcac7
UUID uuid.UUID `json:"uuid" yaml:"uuid" expr:"uuid"`
// Unique identifier of the network associated with the NIC on the source.
// Example: network-123
SourceSpecificID string `json:"source_specific_id" yaml:"source_specific_id" expr:"source_specific_id"`
// MAC address of the NIC.
// Example: 00:0c:29:a1:76:30
HardwareAddress string `json:"hardware_address" yaml:"hardware_address" expr:"hardware_address"`
// Location path of the network associated with the NIC.
// Example: /path/to/my_network
Location string `json:"location" yaml:"location" expr:"location"`
// IPv4 address of the NIC.
// Example: 10.0.0.10
IPv4Address string `json:"ipv4_address" yaml:"ipv4_address" expr:"ipv4_address"`
// IPv6 address of the NIC.
// Example: fd42::1
IPv6Address string `json:"ipv6_address" yaml:"ipv6_address" expr:"ipv6_address"`
}
InstancePropertiesNIC are all properties supported by instance NICs.
type InstancePropertiesSnapshot ¶
type InstancePropertiesSnapshot struct {
// Name of the snapshot.
// Example: snapshot1
Name string `json:"name" yaml:"name" expr:"name"`
}
InstancePropertiesSnapshot are all properties supported by snapshots.
type InstanceRestrictionOverride ¶
type InstanceRestrictionOverride struct {
// Allow migration of instances with unknown OSes.
AllowUnknownOS bool `json:"allow_unknown_os" yaml:"allow_unknown_os"`
// Allow migration of instances with no IPv4 addresses.
AllowNoIPv4 bool `json:"allow_no_ipv4" yaml:"allow_no_ipv4"`
// Allow migration of instances with no background import support.
AllowNoBackgroundImport bool `json:"allow_no_background_import" yaml:"allow_no_background_import"`
}
type MigrationNetworkPlacement ¶
type MigrationNetworkPlacement struct {
NetworkPlacement `yaml:",inline"`
// Target that the network is available in.
Target string `json:"target" yaml:"target"`
// Target project that the network is available in.
TargetProject string `json:"target_project" yaml:"target_project"`
}
type MigrationStatusType ¶
type MigrationStatusType string
const ( MIGRATIONSTATUS_BLOCKED MigrationStatusType = "Blocked" MIGRATIONSTATUS_WAITING MigrationStatusType = "Waiting" MIGRATIONSTATUS_CREATING MigrationStatusType = "Creating new VM" MIGRATIONSTATUS_BACKGROUND_IMPORT MigrationStatusType = "Performing background import tasks" MIGRATIONSTATUS_IDLE MigrationStatusType = "Idle" MIGRATIONSTATUS_FINAL_IMPORT MigrationStatusType = "Performing final import tasks" MIGRATIONSTATUS_POST_IMPORT MigrationStatusType = "Performing post-import tasks" MIGRATIONSTATUS_WORKER_DONE MigrationStatusType = "Worker tasks complete" MIGRATIONSTATUS_FINISHED MigrationStatusType = "Finished" MIGRATIONSTATUS_ERROR MigrationStatusType = "Error" MIGRATIONSTATUS_CANCELED MigrationStatusType = "Canceled" )
func (MigrationStatusType) Validate ¶
func (m MigrationStatusType) Validate() error
Validate ensures the MigrationStatusType is valid.
type MigrationWindow ¶
type MigrationWindow struct {
// Name of the migration window.
Name string `json:"name" yaml:"name"`
// Start time for finalizing migrations after background import.
Start time.Time `json:"start" yaml:"start"`
// End time for finalizing migrations after background import.
End time.Time `json:"end" yaml:"end"`
// Lockout time after which the batch can no longer modify the target instance.
Lockout time.Time `json:"lockout" yaml:"lockout"`
// Configuration for the window.
Config MigrationWindowConfig `json:"config" yaml:"config"`
}
MigrationWindow defines the scheduling of a batch migration.
swagger:model
type MigrationWindowConfig ¶
type MigrationWindowConfig struct {
// Number of instances that can be assigned to the window.
Capacity int `json:"capacity" yaml:"capacity"`
}
type Network ¶
type Network struct {
// UUID of the network.
UUID uuid.UUID `json:"uuid" yaml:"uuid"`
// The source-specific identifier of the network
// Example: network-23
SourceSpecificID string `json:"source_specific_id" yaml:"source_specific_id"`
// vCenter source for the network
// Example: vcenter01
Source string `json:"source" yaml:"source"`
// Type of the network
// Example: standard
Type NetworkType `json:"type" yaml:"type"`
// Full inventory location path of the network
// Example: /vcenter01/network/net0
Location string `json:"location" yaml:"location"`
// Additional properties of the network.
Properties json.RawMessage `json:"properties" yaml:"properties"`
// Target placement configuration for the network.
Placement NetworkPlacement `json:"placement" yaml:"placement"`
// Overrides to the network placement configuration.
Overrides NetworkPlacement `json:"overrides" yaml:"overrides"`
}
Network defines the network config for use by the migration manager.
swagger:model
type NetworkPlacement ¶
type NetworkPlacement struct {
// Name of the network on the target.
// Example: "vmware"
Network string `json:"network" yaml:"network"`
// NIC type of the interface.
// Example: bridged
NICType IncusNICType `json:"nictype" ymal:"nictype"`
// Name of the VLAN ID to use with a VLAN network.
// Example: 1
VlanID string `json:"vlan_id" yaml:"vlan_id"`
}
NetworkPlacement defines the configurable properties of Network.
swagger:model
func (*NetworkPlacement) Apply ¶
func (n *NetworkPlacement) Apply(overrides NetworkPlacement)
Apply updates the properties with the given set of configurable properties. Only non-default values will be applied.
type NetworkType ¶
type NetworkType string
const ( // NETWORKTYPE_VMWARE_STANDARD is a standard vCenter switch-backed port group. NETWORKTYPE_VMWARE_STANDARD NetworkType = "standard" // NETWORKTYPE_VMWARE_DISTRIBUTED is a distributed port group backed by a vCenter distributed switch. NETWORKTYPE_VMWARE_DISTRIBUTED NetworkType = "distributed" // NETWORKTYPE_VMWARE_DISTRIBUTED_NSX is a distributed port group backed by NSX. NETWORKTYPE_VMWARE_DISTRIBUTED_NSX NetworkType = "nsx-distributed" // NETWORKTYPE_VMWARE_NSX is an opaque network managed by NSX. NETWORKTYPE_VMWARE_NSX NetworkType = "nsx" )
type Placement ¶
type Placement struct {
// Name of the target this queue entry is migrating to
// Example: incus01
TargetName string `json:"target_name,omitempty" yaml:"target_name,omitempty"`
// Name of the target project this queue entry is migrating to
// Example: default
TargetProject string `json:"target_project,omitempty" yaml:"target_project,omitempty"`
// Storage pools keyed by attached disk name.
// Example: {"[my-datastore] vmname.vmdk": "default"}
StoragePools map[string]string `json:"storage_pools" yaml:"storage_pools"`
// Network placement configuration keyed by attached network identifier.
// Example: {"00:00:00:00:00:01": "incusbr0"}
Networks map[string]NetworkPlacement `json:"networks" yaml:"networks"`
}
Placement indicates the destination for a queue entry's instance.
type QueueEntry ¶
type QueueEntry struct {
// UUID for the instance; populated from the source and used across all migration manager operations
// Example: 26fa4eb7-8d4f-4bf8-9a6a-dd95d166dfad
InstanceUUID uuid.UUID `json:"instance_uuid" yaml:"instance_uuid"`
// The name of the instance
// Example: UbuntuServer
InstanceName string `json:"instance_name" yaml:"instance_name"`
// The migration status of the instance
// Example: Running
MigrationStatus MigrationStatusType `json:"migration_status" yaml:"migration_status"`
// A free-form string to provide additional information about the migration status
// Example: "Migration 25% complete"
MigrationStatusMessage string `json:"migration_status_message" yaml:"migration_status_message"`
// A human-friendly name for the batch
// Example: MyBatch
BatchName string `json:"batch_name" yaml:"batch_name"`
// Time in UTC that the queue entry received a response from the migration worker
LastWorkerResponse time.Time
// The window that this queue entry will perform the final import steps
MigrationWindow MigrationWindow `json:"migration_window" yaml:"migration_window"`
// Configuration for which target the instance will be placed on.
Placement Placement `json:"placement" yaml:"placement"`
}
QueueEntry provides a high-level status for an instance that is in a migration stage.
swagger:model
type ServerPut ¶
type ServerPut struct {
// Server configuration map (refer to doc/server.md)
// Example: {"core.https_address": ":6443"}
Config map[string]string `json:"config" yaml:"config"`
}
ServerPut represents the modifiable fields of a server configuration
swagger:model
type ServerUntrusted ¶
type ServerUntrusted struct {
ServerPut `yaml:",inline"`
// Support status of the current API (one of "devel", "stable" or "deprecated")
// Read only: true
// Example: stable
APIStatus string `json:"api_status" yaml:"api_status"`
// API version number
// Read only: true
// Example: 1.0
APIVersion string `json:"api_version" yaml:"api_version"`
// Whether the client is trusted (one of "trusted" or "untrusted")
// Read only: true
// Example: untrusted
Auth string `json:"auth" yaml:"auth"`
// List of supported authentication methods
// Read only: true
// Example: ["tls"]
//
// API extension: macaroon_authentication
AuthMethods []string `json:"auth_methods" yaml:"auth_methods"`
}
ServerUntrusted represents a server configuration for an untrusted client
swagger:model
type Source ¶
type Source struct {
SourcePut
// SourceType defines the type of the source
// Example: vmware
SourceType SourceType `json:"source_type" yaml:"source_type"`
}
Source defines properties common to all sources.
swagger:model
type SourcePut ¶
type SourcePut struct {
// A human-friendly name for this source
// Example: MySource
Name string `json:"name" yaml:"name"`
// Properties contains source type specific properties
Properties json.RawMessage `json:"properties" yaml:"properties"`
}
SourcePut defines the configurable properties of Source.
swagger:model
type SourceType ¶
type SourceType string
const ( SOURCETYPE_COMMON SourceType = "common" SOURCETYPE_VMWARE SourceType = "vmware" SOURCETYPE_NSX SourceType = "nsx" )
func NetworkSourceTypes ¶
func NetworkSourceTypes() []SourceType
NetworkSourceTypes are the list of source types that manage networks.
func VMSourceTypes ¶
func VMSourceTypes() []SourceType
VMSourceTypes are the list of source types that manage VMs.
type SystemCertificatePost ¶
type SystemCertificatePost struct {
// The new certificate (X509 PEM encoded) for the system (server certificate).
// Example: X509 PEM certificate
Cert string `json:"certificate" yaml:"certificate"`
// The new certificate key (X509 PEM encoded) for the system (server key).
// Example: X509 PEM certificate key
Key string `json:"key,omitempty" yaml:"key,omitempty"`
// The new certificate CA (X509 PEM encoded) for the system (server CA).
// Example: X509 PEM certificate CA
CA string `json:"ca" yaml:"ca"`
}
SystemCertificatePost represents the fields available for an update of the system certificate (server certificate), key, and CA.
swagger:model
type SystemConfig ¶
type SystemConfig struct {
Network SystemNetwork `json:"network" yaml:"network"`
Security SystemSecurity `json:"security" yaml:"security"`
Settings SystemSettings `json:"settings" yaml:"settings"`
}
SystemConfig is the full set of system configuration options for Migration Manager.
type SystemNetwork ¶
type SystemNetwork struct {
// Address and port to bind the REST API to.
Address string `json:"rest_server_address" yaml:"rest_server_address"`
// URL used by Migration Manager workers to connect to the Migration Manager daemon.
WorkerEndpoint string `json:"worker_endpoint" yaml:"worker_endpoint"`
}
SystemNetwork represents the system's network configuration.
swagger:model
type SystemSecurity ¶
type SystemSecurity struct {
// An array of SHA256 certificate fingerprints that belong to trusted TLS clients.
TrustedTLSClientCertFingerprints []string `json:"trusted_tls_client_cert_fingerprints" yaml:"trusted_tls_client_cert_fingerprints"`
// OIDC configuration.
OIDC SystemSecurityOIDC `json:"oidc" yaml:"oidc"`
// OpenFGA configuration.
OpenFGA SystemSecurityOpenFGA `json:"openfga" yaml:"openfga"`
}
SystemSecurity represents the system's security configuration.
swagger:model
type SystemSecurityOIDC ¶
type SystemSecurityOIDC struct {
// OIDC Issuer.
Issuer string `json:"issuer" yaml:"issuer"`
// Client ID used for communication with the OIDC issuer.
ClientID string `json:"client_id" yaml:"client_id"`
// Scopes to be requested.
Scope string `json:"scopes" yaml:"scopes"`
// Audience the OIDC tokens should be verified against.
Audience string `json:"audience" yaml:"audience"`
// Claim which should be used to identify the user or subject.
Claim string `json:"claim" yaml:"claim"`
}
SystemSecurityOIDC is the OIDC related part of the system's security configuration.
type SystemSecurityOpenFGA ¶
type SystemSecurityOpenFGA struct {
// API token used for communication with the OpenFGA system.
APIToken string `json:"api_token" yaml:"api_token"`
// URL of the OpenFGA API.
APIURL string `json:"api_url" yaml:"api_url"`
// ID of the OpenFGA store.
StoreID string `json:"store_id" yaml:"store_id"`
}
SystemSecurityOpenFGA is the OpenFGA related part of the system's security configuration.
type SystemSettings ¶
type SystemSettings struct {
// Interval over which data from all sources will be periodically resynced.
SyncInterval string `json:"sync_interval" yaml:"sync_interval"`
// Whether automatic periodic sync of all sources should be disabled.
DisableAutoSync bool `json:"disable_auto_sync" yaml:"disable_auto_sync"`
// Daemon log level.
LogLevel string `json:"log_level" yaml:"log_level"`
}
SystemSettings represents global system settings.
swagger:model
type Target ¶
type Target struct {
TargetPut
// TargetType defines the type of the target
TargetType TargetType `json:"target_type" yaml:"target_type"`
}
Target defines properties common to all targets.
swagger:model
type TargetPut ¶
type TargetPut struct {
// A human-friendly name for this target
// Example: MyTarget
Name string `json:"name" yaml:"name"`
// Properties contains target type specific properties
Properties json.RawMessage `json:"properties" yaml:"properties"`
}
TargetPut defines the configurable properties of Target.
swagger:model
type VMwareProperties ¶
type VMwareProperties struct {
// Hostname or IP address of the source endpoint
// Example: vsphere.local
Endpoint string `json:"endpoint" yaml:"endpoint"`
// Store the expected source's TLS certificate, in raw bytes. Useful in situations when TLS certificate validation fails, such as when using self-signed certificates.
ServerCertificate []byte `json:"trusted_server_certificate,omitempty" yaml:"trusted_server_certificate,omitempty"`
// If set and the fingerprint matches that of the ServerCertificate, enables use of that certificate when performing TLS handshake.
// Example: b51b3046a03164a2ca279222744b12fe0878a8c12311c88fad427f4e03eca42d
TrustedServerCertificateFingerprint string `json:"trusted_server_certificate_fingerprint,omitempty" yaml:"trusted_server_certificate_fingerprint,omitempty"`
// Username to authenticate against the endpoint
// Example: admin
Username string `json:"username" yaml:"username"`
// Password to authenticate against the endpoint
// Example: password
Password string `json:"password" yaml:"password"`
// Connectivity status of this source
ConnectivityStatus ExternalConnectivityStatus `json:"connectivity_status" yaml:"connectivity_status"`
// Maximum number of concurrent imports that can occur
// Example: 10
ImportLimit int `json:"import_limit,omitempty" yaml:"import_limit,omitempty"`
}
VMwareProperties defines the set of VMware specific properties of an endpoint that the migration manager can connect to.
type Warning ¶
type Warning struct {
WarningPut `yaml:",inline"`
// Unique identifier of the warning.
// Example: a2095069-a527-4b2a-ab23-1739325dcac7
UUID uuid.UUID `json:"uuid" yaml:"uuid"`
// Scope of the warning.
Scope WarningScope `json:"scope" yaml:"scope"`
// Type of the warning.
// Example: Networks not imported
Type WarningType `json:"type" yaml:"type"`
// First time the warning was seen.
// Example: 2025-01-01 01:00:00
FirstSeenDate time.Time `json:"first_seen_date" yaml:"first_seen_date"`
// Most recent time the warning was seen.
// Example: 2025-01-01 01:00:00
LastSeenDate time.Time `json:"last_seen_date" yaml:"last_seen_date"`
// Last time the warning was changed.
// Example: 2025-01-01 01:00:00
UpdatedDate time.Time `json:"updated_date" yaml:"updated_date"`
// Messages associated with the warning type.
// Example: list of messages
Messages []string `json:"messages" yaml:"messages"`
// Number of times the warning has been seen.
// Example: 10
Count int `json:"count" yaml:"count"`
}
Warning represents a record of a warning.
swagger:model
type WarningPut ¶
type WarningPut struct {
// Current acknowledgement status of the warning.
// Example: new
Status WarningStatus `json:"status" yaml:"status"`
}
WarningPut represents configurable properties of a warning.
swagger:model
type WarningScope ¶
type WarningScope struct {
// Action scope of the warning.
// Example: sync
Scope string `json:"scope" yaml:"scope"`
// Entity the warning relates to.
// Example: source
EntityType string `json:"entity_type" yaml:"entity_type"`
// Name of the entity.
// Example: mySource
Entity string `json:"entity" yaml:"entity"`
}
WarningScope represents a scope for a warning.
func WarningScopeSync ¶
func WarningScopeSync() WarningScope
WarningScopeSync represents a warning scope for syncing a source.
func (WarningScope) Match ¶
func (s WarningScope) Match(w Warning) bool
Match checks whether the given warning is within the given scope.
type WarningStatus ¶
type WarningStatus string
WarningStatus is the acknowledgement status of a warning.
const ( WARNINGSTATUS_NEW WarningStatus = "new" WARNINGSTATUS_ACKNOWLEDGED WarningStatus = "acknowledged" )
type WarningType ¶
type WarningType string
WarningType represents a warning message group.
const ( // NetworkImportFailed indicates a network failed to be imported from its source. NetworkImportFailed WarningType = "Networks not imported" // InstanceImportFailed indicates an instance failed to be imported from its source. InstanceImportFailed WarningType = "Instances not imported" // InstanceMissingNetworkSource indicates an instance contains a network with an external source, but that source is not registered. InstanceMissingNetworkSource WarningType = "External networks with no registered source" SourceUnavailable WarningType = "Sources are unavailable" // InstanceIncomplete indicates an instance was imported with incomplete properties. InstanceIncomplete WarningType = "Instances partially imported" // InstanceCannotMigrate indicates an instance is restricted and cannot be migrated. InstanceCannotMigrate WarningType = "Instance migration is restricted" )
type WorkerCommand ¶
type WorkerCommand struct {
// The command for the worker to execute
// Example: WORKERCOMMAND_IMPORT_DISKS
Command WorkerCommandType `json:"command" yaml:"command"`
// Internal path to the instance
// Example: /SHF/vm/Migration Tests/DebianTest
Location string `json:"location" yaml:"location"`
// SourceType declares the type of the worker and is used as a hint to
// correctly process the details provided in Source.
SourceType SourceType `json:"sourceType" yaml:"sourceType"`
// Source for the worker to fetch VM metadata and/or disk from.
Source json.RawMessage `json:"source" yaml:"source"`
// The name of the operating system
// Example: Ubuntu
OS string `json:"os" yaml:"os"`
// The version of the operating system
// Example: 24.04
OSVersion string `json:"os_version" yaml:"os_version"`
// Operating system type
// Example: linux
OSType OSType `json:"os_type" yaml:"os_type"`
// Architecture of the instance
// Example: x86_64
Architecture string `json:"architecture" yaml:"architecture"`
}
WorkerCommand defines a command sent from the migration manager to a worker.
type WorkerCommandType ¶
type WorkerCommandType int
const ( WORKERCOMMAND_UNKNOWN WorkerCommandType = iota WORKERCOMMAND_IDLE WORKERCOMMAND_IMPORT_DISKS WORKERCOMMAND_FINALIZE_IMPORT WORKERCOMMAND_POST_IMPORT )
type WorkerResponse ¶
type WorkerResponse struct {
// The status of the command the work is/was executing.
// Example: WORKERRESPONSE_RUNNING
Status WorkerResponseType `json:"status" yaml:"status"`
// A free-form string to provide additional information about the command status
// Example: "Migration 25% complete"
StatusMessage string `json:"status_message" yaml:"status_message"`
}
WorkerResponse defines a response received from a worker.
type WorkerResponseType ¶
type WorkerResponseType int
const ( WORKERRESPONSE_UNKNOWN WorkerResponseType = iota WORKERRESPONSE_RUNNING WORKERRESPONSE_SUCCESS WORKERRESPONSE_FAILED )