Skip to content

feat: Implement non-destructive project suspension for compute instances - #200

Open
JoseSzycho wants to merge 3 commits into
mainfrom
182-handle-project-suspension-in-the-compute-service-non-destructive-pauseresume
Open

feat: Implement non-destructive project suspension for compute instances#200
JoseSzycho wants to merge 3 commits into
mainfrom
182-handle-project-suspension-in-the-compute-service-non-destructive-pauseresume

Conversation

@JoseSzycho

Copy link
Copy Markdown
Contributor

Description

This PR introduces the compute-side API signaling and state management for project suspension.

Note: The actual process-halting mechanism is handled by the unikraft-provider (which watches these state changes to delete the backing Pod).

This PR ensures that when a project is suspended, the compute control-plane updates the Instance API to explicitly signal the provider to stop execution. It bypasses standard provisioning and marks the instances as unavailable, but crucially retains their placements, disks, and quota allocations for a seamless resume.

Key Changes

  • API Additions: Added a Suspended boolean to InstanceSpec to act as the signal for the downstream provider, plus corresponding status reason constants (InstanceReadyReasonSuspended, InstanceAvailableReasonSuspended).
  • Service Hooks (suspend_hooks.go): Implemented ComputeSuspend and ComputeResume hooks (implementing the service-catalog consumer interfaces) to idempotently toggle the Suspended flag across all instances in a project.
  • Controller Updates (instance_controller.go): Added reconcileSuspendedState to the InstanceReconciler. When Spec.Suspended is true, it halts normal provisioning, sets Ready and Available conditions to False, and syncs this paused state back to the federation hub.
  • Wiring (cmd/main.go): Registered the new hooks into the consumerprovider.Options.
  • Testing: Added full conformance test coverage (TestConformanceSuspendResume) to ensure the transitions behave correctly and preserve instance identity.

Main enhancement:

Issue:

Comment thread api/v1alpha/instance_types.go Outdated
@JoseSzycho

Copy link
Copy Markdown
Contributor Author

Up! Anyone for reviewing this one? :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Handle project suspension in the compute service (non-destructive pause/resume)

2 participants