Skip to content
This repository has been archived by the owner on Sep 26, 2021. It is now read-only.

Commit

Permalink
exoscale: arbitrary disk size
Browse files Browse the repository at this point in the history
Signed-off-by: Yoan Blanc <yoan.blanc@exoscale.ch>
  • Loading branch information
Yoan Blanc committed Mar 1, 2018
1 parent 9681338 commit 02c8960
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions drivers/exoscale/exoscale.go
Original file line number Diff line number Diff line change
Expand Up @@ -416,8 +416,16 @@ func (d *Driver) Create() error {
// Image UUID
var tpl string
images, ok := topology.Images[strings.ToLower(d.Image)]

if ok {
tpl, ok = images[d.DiskSize]
smallestDiskSize := d.DiskSize
for s := range images {
if s < smallestDiskSize {
smallestDiskSize = s
}
}

tpl, ok = images[smallestDiskSize]
}
if !ok {
return fmt.Errorf("Unable to find image %v with size %d",
Expand Down Expand Up @@ -554,7 +562,7 @@ ssh_authorized_keys:
d.IPAddress = IPAddress.String()
}
d.ID = vm.ID
log.Infof("IP Address: %#v", d.IPAddress)
log.Infof("IP Address: %v, SSH User: %v", d.IPAddress, d.GetSSHUsername())

// Destroy the SSH key from CloudStack
if d.KeyPair != "" {
Expand Down Expand Up @@ -626,7 +634,7 @@ func (d *Driver) Remove() error {

log.Infof("The Anti-Affinity group and Security group were not removed")

return err
return nil
}

// Build a cloud-init user data string that will install and run
Expand Down

0 comments on commit 02c8960

Please sign in to comment.