Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ENHANCEMENT] Prohibit users from resizing volume when vm is stopping. #5407

Closed
Yu-Jack opened this issue Mar 20, 2024 · 5 comments
Closed
Assignees
Labels
area/admission-webhook Kubernetes validation and mutating admission webhooks area/backend Harvester control plane backport-needed/1.2.2 backport-needed/1.3.1 kind/enhancement Issues that improve or augment existing functionality
Milestone

Comments

@Yu-Jack
Copy link
Contributor

Yu-Jack commented Mar 20, 2024

Is your enhancement related to a problem? Please describe.

Currently, this PR #4794 solution doesn't fix the problem which users could resize the volume when vm is stopping.

When we stop vm from kubevirt, its RunStrategy and PrintableStatus will be like this:

  • RunStrategy: RerunOnFailure, , PrintableStatus: Running
  • RunStrategy: Halted, , PrintableStatus: Running
  • RunStrategy: Halted, PrintableStatus: Stopping
  • VMI still exists
  • At this moment, it takes some time to stop vm, so users could edit vm config to resize volume.
  • RunStrategy: Halted, PrintableStatus: Stopped
  • VMI is gone

Describe the solution you'd like

We should change condition order, move PrintableStatus != Stopped to first one.

Describe alternatives you've considered

Additional context

@Yu-Jack Yu-Jack added the kind/enhancement Issues that improve or augment existing functionality label Mar 20, 2024
@Yu-Jack Yu-Jack changed the title [ENHANCEMENT] Users could resize volume when vm status is stopping. [ENHANCEMENT] Prohibit users could resize volume when vm status is stopping. Mar 20, 2024
@Yu-Jack Yu-Jack self-assigned this Mar 20, 2024
@Yu-Jack Yu-Jack added area/backend Harvester control plane area/admission-webhook Kubernetes validation and mutating admission webhooks labels Mar 20, 2024
@Yu-Jack Yu-Jack added this to the v1.4.0 milestone Mar 20, 2024
@harvesterhci-io-github-bot
Copy link
Collaborator

added backport-needed/1.2.2 issue: #5408.

@Yu-Jack Yu-Jack changed the title [ENHANCEMENT] Prohibit users could resize volume when vm status is stopping. [ENHANCEMENT] Prohibit users from resizing volume when vm status is stopping. Mar 20, 2024
@Yu-Jack Yu-Jack changed the title [ENHANCEMENT] Prohibit users from resizing volume when vm status is stopping. [ENHANCEMENT] Prohibit users from resizing volume when vm is stopping. Mar 20, 2024
@harvesterhci-io-github-bot
Copy link
Collaborator

added backport-needed/1.3.1 issue: #5427.

@harvesterhci-io-github-bot
Copy link
Collaborator

harvesterhci-io-github-bot commented Mar 22, 2024

Pre Ready-For-Testing Checklist

  • If NOT labeled: not-require/test-plan Has the e2e test plan been merged? Have QAs agreed on the automation test case? If only test case skeleton w/o implementation, have you created an implementation issue?

    • The automation skeleton PR is at:
    • The automation test case PR is at:
  • If the fix introduces the code for backward compatibility Has a separate issue been filed with the label release/obsolete-compatibility?
    The compatibility issue is filed at:

@harvesterhci-io-github-bot
Copy link
Collaborator

Automation e2e test issue: harvester/tests#1180

@albinsun
Copy link

Test PASS on harvester-v1.4.0-dev-20240830.

Environment

  • harvester-v1.4.0-dev-20240830
    • Profile: 2 nodes QEMU/KVM (8C/16G/500G per node)
    • ui-source: Auto

Prerequisite

  1. Fresh install harvester with any nodes

    image

  2. Create a VM, check Running.

    image

Steps

  1. VM => ⋮ => Edit Config, should NOT be able to resize. ✔️

    image

  2. Stop VM => ⋮ => Edit Config when Stopping, should NOT be able to resize. ✔️

    image

  3. Check VM Stopped => ⋮ => Edit Config, should be able to resize. ✔️
    • Resizing
      image
    • Ready
      image
  4. Start VM, check Running and disk do resized. ✔️
    • VM Running
      image
    • Volume do resized
      image

Note

  1. enhancement: prohibit users from resizing volume when vm is stopping #5409

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/admission-webhook Kubernetes validation and mutating admission webhooks area/backend Harvester control plane backport-needed/1.2.2 backport-needed/1.3.1 kind/enhancement Issues that improve or augment existing functionality
Projects
None yet
Development

No branches or pull requests

4 participants