4.7.6
This commit is contained in:
@@ -806,10 +806,15 @@ func resourceComputeUpdate(ctx context.Context, d *schema.ResourceData, m interf
|
||||
}
|
||||
}
|
||||
|
||||
// Note bene: numa_affinity, cpu_pin, "ram", "cpu" and hp_backed are not allowed to be changed for compute in STARTED tech status.
|
||||
// Note bene: numa_affinity, cpu_pin, old_cpu > new_cpu and hp_backed are not allowed to be changed for compute in STARTED tech status.
|
||||
// If STARTED, we need to stop it before update
|
||||
var isStopRequired bool
|
||||
if d.HasChanges("numa_affinity", "cpu_pin", "hp_backed", "ram", "cpu") && d.Get("started").(bool) {
|
||||
if d.HasChanges("numa_affinity", "cpu_pin", "hp_backed") && d.Get("started").(bool) {
|
||||
isStopRequired = true
|
||||
}
|
||||
|
||||
old, new := d.GetChange("cpu")
|
||||
if old.(int) > new.(int) && d.Get("started").(bool) {
|
||||
isStopRequired = true
|
||||
}
|
||||
if isStopRequired {
|
||||
|
||||
@@ -115,7 +115,8 @@ func utilityComputeResize(ctx context.Context, d *schema.ResourceData, m interfa
|
||||
computeId, _ := strconv.ParseUint(d.Id(), 10, 64)
|
||||
|
||||
var isStopRequired bool
|
||||
if d.Get("started").(bool) {
|
||||
old, new := d.GetChange("cpu")
|
||||
if d.Get("started").(bool) && (old.(int) > new.(int)) {
|
||||
isStopRequired = true
|
||||
}
|
||||
if isStopRequired {
|
||||
|
||||
Reference in New Issue
Block a user