4.9.4
This commit is contained in:
@@ -111,7 +111,13 @@ 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) {
|
||||
var isStopRequired bool
|
||||
|
||||
old, new := d.GetChange("cpu")
|
||||
if d.Get("started").(bool) && (old.(int) > new.(int)) {
|
||||
isStopRequired = true
|
||||
}
|
||||
if isStopRequired {
|
||||
stopReq := compute.StopRequest{
|
||||
ComputeID: computeId,
|
||||
Force: false,
|
||||
@@ -176,7 +182,7 @@ func utilityComputeResize(ctx context.Context, d *schema.ResourceData, m interfa
|
||||
}
|
||||
}
|
||||
|
||||
if d.Get("started").(bool) {
|
||||
if isStopRequired {
|
||||
if _, err := c.CloudBroker().Compute().Start(ctx, compute.StartRequest{ComputeID: computeId}); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user