Files
Provisioning/internal/model/model.go
T
josh 81abb94806
build-and-push / test (push) Successful in 34s
build-and-push / build-and-push (push) Successful in 1m11s
Serve full ISO for PXE boot via proxmox-iso-url kernel param
The Proxmox installer needs the full ISO to access packages and
installer data. Previously the ISO was deleted after extracting
kernel+initrd. Now we keep it as original.iso and serve it via HTTP.
The iPXE script passes proxmox-iso-url=<url> so the installer
fetches the ISO over the network instead of scanning block devices.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-14 11:11:45 -04:00

101 lines
1.9 KiB
Go

package model
import "time"
type HostState string
const (
StateRegistered HostState = "registered"
StatePXEReady HostState = "pxe_ready"
StatePXEBooted HostState = "pxe_booted"
StateInstalling HostState = "installing"
StateInstalled HostState = "installed"
StateFirstBoot HostState = "first_boot"
StateJoining HostState = "joining"
StateReady HostState = "ready"
StateFailed HostState = "failed"
)
type Host struct {
ID int64
Hostname string
MAC string
ServerType string
State HostState
IPAddress string
HardwareID string
InfraHostID int64
Notes string
CreatedAt time.Time
UpdatedAt time.Time
}
type OperationKind string
const (
OpRebuildProxmox OperationKind = "rebuild_proxmox"
)
type OperationState string
const (
OpActive OperationState = "active"
OpCompleted OperationState = "completed"
OpFailed OperationState = "failed"
)
type Operation struct {
ID int64
HostID int64
Kind OperationKind
State OperationState
ImageID int64
StartedAt time.Time
CompletedAt *time.Time
ErrorMessage string
}
type Image struct {
ID int64
Name string
Kind string
Version string
KernelPath string
InitrdPath string
ISOPath string
IsDefault bool
CreatedAt time.Time
}
type LogLevel string
const (
LogInfo LogLevel = "info"
LogWarn LogLevel = "warn"
LogError LogLevel = "error"
)
type ActivityEntry struct {
ID int64
HostID int64
OperationID int64
Level LogLevel
Message string
Source string
CreatedAt time.Time
}
type ServerType struct {
Key string
DisplayName string `yaml:"display_name"`
BootDisk string `yaml:"boot_disk"`
ManagementNIC string `yaml:"management_nic"`
GPU bool `yaml:"gpu"`
ExpectedNICs []NICDef `yaml:"expected_nics"`
}
type NICDef struct {
Name string `yaml:"name"`
Speed string `yaml:"speed"`
}