This commit is contained in:
dayterr
2025-08-07 14:16:39 +03:00
parent 7546634d05
commit e0e788cacc
3677 changed files with 12 additions and 402401 deletions

View File

@@ -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 {

View File

@@ -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 {