Skip to content

Commit

Permalink
fix: set disk status when requesting disk reset (#20192)
Browse files Browse the repository at this point in the history
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
  • Loading branch information
swordqiu and Qiu Jian authored May 4, 2024
1 parent 43ac987 commit 8b5afbf
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/compute/models/disks.go
Original file line number Diff line number Diff line change
Expand Up @@ -3111,6 +3111,8 @@ func (disk *SDisk) PerformRebuild(
if guest.GetStatus() != api.VM_READY {
return nil, httperrors.NewInvalidStatusError("Guest %s status is %s", guest.GetId(), guest.GetStatus())
}
guest.SetStatus(ctx, userCred, api.VM_DISK_RESET, "disk rebuild")
}
disk.SetStatus(ctx, userCred, api.DISK_REBUILD, "disk rebuild")
return nil, disk.StartDiskCreateTask(ctx, userCred, true, disk.SnapshotId, "")
}

0 comments on commit 8b5afbf

Please sign in to comment.