Skip to content

Commit eeb6a62

Browse files
committed
Merge branch 'development/v1.0' of https://github.com/DimensionDataResearch/docker-machine-driver-ddcloud into development/v1.0
2 parents 54a040d + 087f6ed commit eeb6a62

File tree

3 files changed

+18
-12
lines changed

3 files changed

+18
-12
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ Environment: `MCP_REGION`.
4343
* `ddcloud-networkdomain` - The name of the target CloudControl network domain.
4444
* `ddcloud-datacenter` - The name of the CloudControl datacenter (e.g. NA1, AU9) in which the network domain is located.
4545
* `ddcloud-vlan` - The name of the target CloudControl VLAN.
46-
* `ddcloud-memorygb` - The amount of RAM in GB for the target machine. (Default 4GB)
47-
* `ddcloud-cpucount` - The amount of CPUs for the target machine. (Default: 2)
48-
* `ddcloud-corespersocket` - The amount of cores per socket for the target machine. (Default: 2)
46+
* `ddcloud-memorygb` - The amount of RAM in GB for the target machine. (Default: taken from image)
47+
* `ddcloud-cpucount` - The amount of CPUs for the target machine. (Default: taken from image)
48+
* `ddcloud-corespersocket` - The amount of cores per socket for the target machine. (Default: taken from image)
4949
* `ddcloud-image-name` - The name of the image used to create the target machine.
5050
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).
5151
* `ddcloud-ssh-user` - The SSH username to use.

client.go

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -336,9 +336,15 @@ func (driver *Driver) buildDeploymentConfiguration() (deploymentConfiguration co
336336
image.ApplyTo(&deploymentConfiguration)
337337

338338
// Customise memory and / or CPU (if required).
339-
deploymentConfiguration.MemoryGB = driver.MemoryGB
340-
deploymentConfiguration.CPU.Count = driver.CPUCount
341-
deploymentConfiguration.CPU.CoresPerSocket = driver.CoresPerSocket
339+
if driver.MemoryGB != -1 {
340+
deploymentConfiguration.MemoryGB = driver.MemoryGB
341+
}
342+
if driver.CPUCount != -1 {
343+
deploymentConfiguration.CPU.Count = driver.CPUCount
344+
}
345+
if driver.CoresPerSocket != -1 {
346+
deploymentConfiguration.CPU.CoresPerSocket = driver.CoresPerSocket
347+
}
342348

343349
return
344350
}

driver.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -210,18 +210,18 @@ func (driver *Driver) GetCreateFlags() []mcnflag.Flag {
210210
},
211211
mcnflag.IntFlag{
212212
Name: "ddcloud-memorygb",
213-
Usage: "The amount of RAM in GB for the target machine. Default: 4",
214-
Value: 4,
213+
Usage: "The amount of RAM in GB for the target machine. Default: -1 (Image default)",
214+
Value: -1,
215215
},
216216
mcnflag.IntFlag{
217217
Name: "ddcloud-cpucount",
218-
Usage: "The amount of CPUs for the target machine. Default: 2",
219-
Value: 2,
218+
Usage: "The amount of CPUs for the target machine. Default: -1 (Image default)",
219+
Value: -1,
220220
},
221221
mcnflag.IntFlag{
222222
Name: "ddcloud-corespersocket",
223-
Usage: "The amount of cores per socket for the target machine. Default: 2",
224-
Value: 2,
223+
Usage: "The amount of cores per socket for the target machine. Default: -1 (Image default)",
224+
Value: -1,
225225
},
226226
}
227227
}

0 commit comments

Comments
 (0)