4.9.3
This commit is contained in:
@@ -111,6 +111,16 @@ func utilityComputeResize(ctx context.Context, d *schema.ResourceData, m interfa
|
||||
c := m.(*controller.ControllerCfg)
|
||||
computeId, _ := strconv.ParseUint(d.Id(), 10, 64)
|
||||
|
||||
if d.Get("started").(bool) {
|
||||
stopReq := compute.StopRequest{
|
||||
ComputeID: computeId,
|
||||
Force: false,
|
||||
}
|
||||
if _, err := c.CloudBroker().Compute().Stop(ctx, stopReq); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
resizeReq := compute.ResizeRequest{
|
||||
ComputeID: computeId,
|
||||
}
|
||||
@@ -166,6 +176,12 @@ func utilityComputeResize(ctx context.Context, d *schema.ResourceData, m interfa
|
||||
}
|
||||
}
|
||||
|
||||
if d.Get("started").(bool) {
|
||||
if _, err := c.CloudBroker().Compute().Start(ctx, compute.StartRequest{ComputeID: computeId}); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user