mirror of
https://github.com/cozystack/cozystack.git
synced 2026-11-22 12:43:32 +09:00
Hidora's customers are leaving VMware now, and a tenant has to be able to import their own machines without a platform administrator. The chart approach could not express that: a tenant can neither create the Secret holding vCenter credentials nor name the VDDK image, so both had to come from somewhere they cannot reach. Two CRDs in a new `forklift.cozystack.io` group, split by lifecycle. A VMImportSource is a long-lived connection -- type, endpoint, credentials, readiness -- and a VMImportTask is the one-shot operation that names machines and produces VMDisks and VMInstances. The outputs carry no owner reference back to the task, so deleting a finished import leaves the machines alone. Konveyor Forklift does the transfer underneath; the controller renders its objects, mirrors its verdicts, and hands each finished volume into a VMDisk without copying it. What a live vCenter migration forced out, and no amount of source reading would have: - A guest copied verbatim keeps the drivers it had under VMware and no virtio, so on a virtio disk it does not fail the import -- it succeeds and then does not boot. Imported disks go on SATA. - VDDK connects straight to the ESXi host at the address vCenter advertises, which is routinely unreachable, and on the first cluster collided with the Service CIDR. `spec.hosts` redirects per host. - Firmware must be carried across or a UEFI guest imports as BIOS and never boots (stacked on #3002). - Deleting a task mid-transfer orphaned its DataVolume; a finalizer now removes the engine's volumes and leaves the outputs. The console gains a Migration section: connections are editable, and the VM field is a picker built from a machine list the controller publishes, since the aggregated API cannot reach the inventory and should not hold a source's credentials to try. Two general mechanisms fall out of that -- an option source may take an argument, and one named in a CRD annotation may reference a sibling field. Design: cozystack/community#62. Docs: cozystack/website#673. Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
122 lines
4.5 KiB
YAML
122 lines
4.5 KiB
YAML
##
|
|
## @section Common parameters
|
|
##
|
|
|
|
## @enum {string} ExternalMethod - Method to pass through traffic to the VM.
|
|
## @value PortList - Forward selected ports only.
|
|
## @value WholeIP - Forward all traffic for the IP.
|
|
|
|
## @typedef {struct} Disk - Disk configuration.
|
|
## @field {string} name - Disk name.
|
|
## @x-cozystack-options {source: vmdisk}
|
|
## @field {string} [bus] - Disk bus type (e.g. "sata").
|
|
|
|
## @typedef {struct} Network - Network to attach the VM to.
|
|
## @field {string} [name] - Network attachment name.
|
|
## @x-cozystack-options {source: network}
|
|
|
|
## @typedef {struct} GPU - GPU device configuration.
|
|
## @field {string} name - The name of the GPU resource to attach.
|
|
## @x-cozystack-options {source: gpu}
|
|
|
|
## @typedef {struct} Resources - Resource configuration for the virtual machine.
|
|
## @field {quantity} [cpu] - Number of CPU cores allocated.
|
|
## @field {quantity} [memory] - Amount of memory allocated.
|
|
## @field {quantity} [sockets] - Number of CPU sockets (vCPU topology).
|
|
|
|
## @typedef {struct} Firmware - Firmware and boot configuration. When left empty, the boot mode is inherited from the instanceProfile.
|
|
## @field {string} [bootloader] - Bootloader to boot the VM with: "uefi" (OVMF) or "bios" (SeaBIOS). Empty inherits the instanceProfile default.
|
|
## @field {bool} [secureBoot] - Enable UEFI Secure Boot. Only applies when bootloader is "uefi".
|
|
## @field {bool} [efiPersistent] - Persist EFI NVRAM (e.g. enrolled Secure Boot keys, such as an updated Microsoft UEFI CA) across reboots. Only applies when bootloader is "uefi". On default RWO storage the VM is node-pinned (no live-migration).
|
|
|
|
## @param {bool} external - Enable external access from outside the cluster.
|
|
external: false
|
|
|
|
## @param {ExternalMethod} externalMethod - Method to pass through traffic to the VM.
|
|
externalMethod: PortList
|
|
|
|
## @param {[]int} externalPorts - Ports to forward from outside the cluster.
|
|
externalPorts:
|
|
- 22
|
|
|
|
## @param {bool} externalAllowICMP - Whether to accept ICMP traffic to the VM in PortList mode (preserves ping and PMTU discovery). No effect in WholeIP mode. Default true so ping behaves as users expect even when port filtering is in effect.
|
|
externalAllowICMP: true
|
|
|
|
## @enum {string} RunStrategy - Requested running state of the VirtualMachineInstance
|
|
## @value Always - VMI should always be running
|
|
## @value Halted - VMI should never be running
|
|
## @value Manual - VMI can be started/stopped using API endpoints
|
|
## @value RerunOnFailure - VMI will initially be running and restarted if a failure occurs, but will not be restarted upon successful completion
|
|
## @value Once - VMI will run once and not be restarted upon completion regardless if the completion is of phase Failure or Success
|
|
|
|
## @param {RunStrategy} runStrategy - Requested running state of the VirtualMachineInstance
|
|
runStrategy: Always
|
|
|
|
## @param {string} instanceType - Virtual Machine instance type.
|
|
## @x-cozystack-options {source: instancetype}
|
|
instanceType: "u1.medium"
|
|
|
|
## @param {string} instanceProfile - Virtual Machine preferences profile.
|
|
## @x-cozystack-options {source: instanceprofile}
|
|
instanceProfile: ubuntu
|
|
|
|
## @param {[]Disk} disks - List of disks to attach.
|
|
disks: []
|
|
## Example:
|
|
## disks:
|
|
## - name: example-system
|
|
## - name: example-data
|
|
## bus: sata
|
|
|
|
## @param {[]Network} networks - Networks to attach the VM to.
|
|
networks: []
|
|
## Example:
|
|
## networks:
|
|
## - name: subnet-84dbec17
|
|
## - name: subnet-aa8896b5
|
|
|
|
## @param {[]Network} subnets - Deprecated: use networks instead.
|
|
subnets: []
|
|
|
|
## @param {[]GPU} gpus - List of GPUs to attach (NVIDIA driver requires at least 4 GiB RAM).
|
|
gpus: []
|
|
## Example:
|
|
## gpus:
|
|
## - name: nvidia.com/GA102GL_A10
|
|
|
|
## @param {string} cpuModel - Model specifies the CPU model inside the VMI. List of available models https://github.com/libvirt/libvirt/tree/master/src/cpu_map
|
|
cpuModel: ""
|
|
|
|
## @param {Firmware} [firmware] - Firmware and boot configuration (UEFI/BIOS selection, Secure Boot, persistent EFI NVRAM).
|
|
firmware: {}
|
|
## Example:
|
|
## firmware:
|
|
## bootloader: uefi
|
|
## secureBoot: true
|
|
## efiPersistent: true
|
|
|
|
## @param {Resources} [resources] - Resource configuration for the virtual machine.
|
|
resources: {}
|
|
|
|
## @param {[]string} sshKeys - List of SSH public keys for authentication.
|
|
sshKeys: []
|
|
## Example:
|
|
## sshKeys:
|
|
## - ssh-rsa ...
|
|
## - ssh-ed25519 ...
|
|
##
|
|
|
|
## @param {string} cloudInit - Cloud-init user data.
|
|
cloudInit: ""
|
|
## Example:
|
|
## cloudInit: |
|
|
## #cloud-config
|
|
## password: ubuntu
|
|
## chpasswd: { expire: False }
|
|
##
|
|
|
|
## @param {string} cloudInitSeed - Seed string to generate SMBIOS UUID for the VM.
|
|
cloudInitSeed: ""
|
|
## Example:
|
|
## cloudInitSeed: "upd1"
|