mirror of
https://github.com/cirruslabs/orchard.git
synced 2026-09-29 19:41:15 +02:00
Allow creating VMs with implicit CPU and memory (#243)
* Allow creating VMs with implicit CPU and memory * Clarify why cpu/memory can be 0 a bit better * Controller(API): don't forget to update DefaultCPU and DefaultMemory * Add an integration test for implicit CPU and memory
This commit is contained in:
@@ -34,6 +34,19 @@ type VM struct {
|
||||
// Worker field is set by the Controller to assign this VM to a specific Worker.
|
||||
Worker string `json:"worker,omitempty"`
|
||||
|
||||
// AssignedCPU is set by the Controller when the VM is scheduled.
|
||||
//
|
||||
// It's set to CPU when CPU non-zero, otherwise the value is taken from
|
||||
// Worker's DefaultCPU field. If Worker's DefaultCPU field is zero, it defaults
|
||||
// to 4.
|
||||
AssignedCPU uint64 `json:"assignedCPU,omitempty"`
|
||||
// AssignedMemory is set by the Controller
|
||||
//
|
||||
// It's set to Memory when Memory non-zero, otherwise the value is taken from
|
||||
// Worker's DefaultCPU field. If Worker's DefaultCPU field is zero, it defaults
|
||||
// to 8192.
|
||||
AssignedMemory uint64 `json:"assignedMemory,omitempty"`
|
||||
|
||||
Username string `json:"username,omitempty"`
|
||||
Password string `json:"password,omitempty"`
|
||||
StartupScript *VMScript `json:"startup_script,omitempty"`
|
||||
|
||||
@@ -14,6 +14,13 @@ type Worker struct {
|
||||
// Resources available on this Worker.
|
||||
Resources Resources `json:"resources,omitempty"`
|
||||
|
||||
// DefaultCPU is the amount of CPUs to assign to a VM
|
||||
// when it doesn't explicitly request a specific amount.
|
||||
DefaultCPU uint64 `json:"defaultCPU,omitempty"`
|
||||
// DefaultMemory is the amount of memory to assign to a VM
|
||||
// when it doesn't explicitly request a specific amount.
|
||||
DefaultMemory uint64 `json:"defaultMemory,omitempty"`
|
||||
|
||||
Meta
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user