Skip to content

Commit

Permalink
Merge pull request #14 from tmuskal/development/v1.0
Browse files Browse the repository at this point in the history
bring back support for default image settings (cpu & memory)
  • Loading branch information
tintoy authored May 17, 2018
2 parents d88fb40 + 274f456 commit 087f6ed
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 12 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ Environment: `MCP_REGION`.
* `ddcloud-networkdomain` - The name of the target CloudControl network domain.
* `ddcloud-datacenter` - The name of the CloudControl datacenter (e.g. NA1, AU9) in which the network domain is located.
* `ddcloud-vlan` - The name of the target CloudControl VLAN.
* `ddcloud-memorygb` - The amount of RAM in GB for the target machine. (Default 4GB)
* `ddcloud-cpucount` - The amount of CPUs for the target machine. (Default: 2)
* `ddcloud-corespersocket` - The amount of cores per socket for the target machine. (Default: 2)
* `ddcloud-memorygb` - The amount of RAM in GB for the target machine. (Default: taken from image)
* `ddcloud-cpucount` - The amount of CPUs for the target machine. (Default: taken from image)
* `ddcloud-corespersocket` - The amount of cores per socket for the target machine. (Default: taken from image)
* `ddcloud-image-name` - The name of the image used to create the target machine.
Additionally, the OS must be a Linux distribution supported by docker-machine (Ubuntu 12.04 and above are supported, but RedHat 6 and 7 are not supported due to iptables configuration issues).
* `ddcloud-ssh-user` - The SSH username to use.
Expand Down
12 changes: 9 additions & 3 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -336,9 +336,15 @@ func (driver *Driver) buildDeploymentConfiguration() (deploymentConfiguration co
image.ApplyTo(&deploymentConfiguration)

// Customise memory and / or CPU (if required).
deploymentConfiguration.MemoryGB = driver.MemoryGB
deploymentConfiguration.CPU.Count = driver.CPUCount
deploymentConfiguration.CPU.CoresPerSocket = driver.CoresPerSocket
if driver.MemoryGB != -1 {
deploymentConfiguration.MemoryGB = driver.MemoryGB
}
if driver.CPUCount != -1 {
deploymentConfiguration.CPU.Count = driver.CPUCount
}
if driver.CoresPerSocket != -1 {
deploymentConfiguration.CPU.CoresPerSocket = driver.CoresPerSocket
}

return
}
Expand Down
12 changes: 6 additions & 6 deletions driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,18 +210,18 @@ func (driver *Driver) GetCreateFlags() []mcnflag.Flag {
},
mcnflag.IntFlag{
Name: "ddcloud-memorygb",
Usage: "The amount of RAM in GB for the target machine. Default: 4",
Value: 4,
Usage: "The amount of RAM in GB for the target machine. Default: -1 (Image default)",
Value: -1,
},
mcnflag.IntFlag{
Name: "ddcloud-cpucount",
Usage: "The amount of CPUs for the target machine. Default: 2",
Value: 2,
Usage: "The amount of CPUs for the target machine. Default: -1 (Image default)",
Value: -1,
},
mcnflag.IntFlag{
Name: "ddcloud-corespersocket",
Usage: "The amount of cores per socket for the target machine. Default: 2",
Value: 2,
Usage: "The amount of cores per socket for the target machine. Default: -1 (Image default)",
Value: -1,
},
}
}
Expand Down

0 comments on commit 087f6ed

Please sign in to comment.