mirror of https://github.com/cirruslabs/tart.git
tart create --linux: allow scaling VM down to 1 CPU and 256 MiB
This commit is contained in:
parent
36c54d95cb
commit
7a31443eea
|
|
@ -223,7 +223,7 @@ class VM: NSObject, VZVirtualMachineDelegate, ObservableObject {
|
|||
try vmDir.resizeDisk(diskSizeGB)
|
||||
|
||||
// Create config
|
||||
let config = VMConfig(platform: Linux(), cpuCountMin: 4, memorySizeMin: 4096 * 1024 * 1024)
|
||||
let config = VMConfig(platform: Linux(), cpuCountMin: 1, cpuCount: 4, memorySizeMin: 256 * 1024 * 1024, memorySize: 4096 * 1024 * 1024)
|
||||
try config.save(toURL: vmDir.configURL)
|
||||
|
||||
return try VM(vmDir: vmDir)
|
||||
|
|
|
|||
|
|
@ -58,15 +58,29 @@ struct VMConfig: Codable {
|
|||
cpuCountMin: Int,
|
||||
memorySizeMin: UInt64,
|
||||
macAddress: VZMACAddress = VZMACAddress.randomLocallyAdministered()
|
||||
) {
|
||||
self.init(platform: platform,
|
||||
cpuCountMin: cpuCountMin, cpuCount: cpuCountMin,
|
||||
memorySizeMin: memorySizeMin, memorySize: memorySizeMin,
|
||||
macAddress: macAddress)
|
||||
}
|
||||
|
||||
init(
|
||||
platform: Platform,
|
||||
cpuCountMin: Int,
|
||||
cpuCount: Int,
|
||||
memorySizeMin: UInt64,
|
||||
memorySize: UInt64,
|
||||
macAddress: VZMACAddress = VZMACAddress.randomLocallyAdministered()
|
||||
) {
|
||||
self.os = platform.os()
|
||||
self.arch = CurrentArchitecture()
|
||||
self.platform = platform
|
||||
self.macAddress = macAddress
|
||||
self.cpuCountMin = cpuCountMin
|
||||
self.cpuCount = cpuCount
|
||||
self.memorySizeMin = memorySizeMin
|
||||
cpuCount = cpuCountMin
|
||||
memorySize = memorySizeMin
|
||||
self.memorySize = memorySize
|
||||
}
|
||||
|
||||
init(fromJSON: Data) throws {
|
||||
|
|
|
|||
Loading…
Reference in New Issue