mirror of
https://github.com/retspen/webvirtcloud
synced 2026-12-02 08:56:07 +00:00
fix(instances): a VM with a saved state says so and can start without it
A VM with a managed save image showed as plain Off; Power On restored the saved memory and the panel had no way to boot it fresh or drop the saved state. The power tab now says the VM has a saved state and offers Start Without Saved State (confirmed), which boots it with VIR_DOMAIN_START_FORCE_BOOT and so discards the image. Owners get it as they get Power On; the audit row names it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
This commit is contained in:
parent
015972dc38
commit
0ce1139c9d
11 changed files with 308 additions and 225 deletions
|
|
@ -33,6 +33,7 @@ from .serializers import (
|
|||
InstanceDetailsSerializer,
|
||||
InstanceSerializer,
|
||||
MigrateSerializer,
|
||||
PowerOnSerializer,
|
||||
)
|
||||
|
||||
|
||||
|
|
@ -138,7 +139,7 @@ class InstanceViewSet(viewsets.ViewSet):
|
|||
return Response(OperationSerializer(op, context={"request": request}).data, status=status.HTTP_202_ACCEPTED,
|
||||
headers={"Location": reverse("operation-detail", args=[op.pk])})
|
||||
|
||||
@extend_schema(request=None, responses={200: ActionStatusSerializer, 409: ErrorSerializer})
|
||||
@extend_schema(request=PowerOnSerializer, responses={200: ActionStatusSerializer, 409: ErrorSerializer})
|
||||
@action(detail=True, methods=["post"])
|
||||
def poweron(self, request, pk=None, compute_pk=None):
|
||||
queryset = get_instance(request.user, pk, perm_type="power")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue