This commit is contained in:
2024-05-31 13:35:39 +03:00
parent e7c968797b
commit 3393934456
65 changed files with 905 additions and 393 deletions

View File

@@ -14,7 +14,8 @@ type Interface struct {
// Should be one of:
// - VINS
// - EXTNET
NetType string `url:"netType" json:"netType" validate:"required,kvmNetType"`
// - VFNIC
NetType string `url:"netType" json:"netType" validate:"required,kvmx86NetType"`
// Network ID for connect to,
// for EXTNET - external network ID,
@@ -74,10 +75,14 @@ type CreateRequest struct {
// Required: true
RAM uint64 `url:"ram" json:"ram" validate:"required"`
// If True, the imageId, bootDisk, sepId, pool parameters are ignored and the compute is created without a boot disk in the stopped state
// Required: false
WithoutBootDisk bool `url:"withoutBootDisk" json:"withoutBootDisk"`
// ID of the OS image to base this VM on;
// Could be boot disk image or CD-ROM image
// Required: true
ImageID uint64 `url:"imageId" json:"imageId" validate:"required"`
// Required: false
ImageID uint64 `url:"imageId,omitempty" json:"imageId,omitempty"`
// Size of the boot disk in GB
// Required: false
@@ -131,6 +136,24 @@ type CreateRequest struct {
// Type of compute Stateful (KVM_X86) or Stateless (SVA_KVM_X86)
// Required: false
Driver string `url:"driver,omitempty" json:"driver,omitempty" validate:"omitempty,computeDriver"`
// Rule for VM placement with NUMA affinity.
// Possible values - none (placement without NUMA affinity),
// strict (strictly with NUMA affinity, if not possible - do not start VM),
// loose (use NUMA affinity if possible)
// Required: false
// Default: none
NumaAffinity string `url:"numaAffinity,omitempty" json:"numaAffinity,omitempty" validate:"omitempty,numaAffinity"`
// Run VM on dedicated CPUs. To use this feature, the system must be pre-configured by allocating CPUs on the physical node
// Required: false
// Default: false
CPUPin bool `url:"cpupin" json:"cpupin"`
// Use Huge Pages to allocate RAM of the virtual machine. The system must be pre-configured by allocating Huge Pages on the physical node
// Required: false
// Default: false
HPBacked bool `url:"hpBacked" json:"hpBacked"`
}
// GetRAM returns RAM field values

View File

@@ -28,18 +28,22 @@ type CreateBlankRequest struct {
// Required: true
RAM uint64 `url:"ram" json:"ram" validate:"required"`
// If True, the imageId, bootDisk, sepId, pool parameters are ignored and the compute is created without a boot disk in the stopped state
// Required: false
WithoutBootDisk bool `url:"withoutBootDisk" json:"withoutBootDisk"`
// Size of the boot disk in GB
// Required: true
BootDisk uint64 `url:"bootDisk" json:"bootDisk" validate:"required"`
// Required: false
BootDisk uint64 `url:"bootDisk,omitempty" json:"bootDisk,omitempty"`
// ID of SEP to create boot disk on.
// Uses images SEP ID if not set
// Required: true
SEPID uint64 `url:"sepId" json:"sepId" validate:"required"`
// Required: false
SEPID uint64 `url:"sepId,omitempty" json:"sepId,omitempty"`
// Pool to use if sepId is set, can be also empty if needed to be chosen by system
// Required: true
Pool string `url:"pool" json:"pool" validate:"required"`
// Required: false
Pool string `url:"pool,omitempty" json:"pool,omitempty"`
// Slice of structs with data disk description. Each disk has parameters: required - diskName, size; optional - sepId, pool, desc and imageId.
// If not specified, compute will be created without disks.