Skip to content

Force-stop VM succeed but VM is still running on host if cloudstack-agent is stopped #6798

Closed

Description

@weizhouapache

Steps to reproduce the issue

on KVM

  • create a vm and start it
  • stop cloudstack-agent
  • force-stop the VM
  • VM is stopped but it is still running on kvm host

This seems incorrect to me. but devs/users may have different opinion.

ISSUE TYPE
  • Bug Report
COMPONENT NAME

server

CLOUDSTACK VERSION

4.18

CONFIGURATION
OS / ENVIRONMENT

kvm

SUMMARY
STEPS TO REPRODUCE

EXPECTED RESULTS

ACTUAL RESULTS

Activity

  1. DaanHoogland commented on Oct 3, 2022

    @DaanHoogland
    Contributor

    @weizhouapache I did merge some kvm related commits. did you verify this on 4.17?

  2. weizhouapache commented on Oct 3, 2022

    @weizhouapache
    MemberAuthor

    @DaanHoogland
    I got the same result on a 4.17.1.0 env

  3. DaanHoogland commented on Oct 3, 2022

    @DaanHoogland
    Contributor

    Ok, not a regression, but still a major bug. This may result in data corruption of the VM is started again.

  4. added this to the 4.18.0.0 milestone on Oct 3, 2022
  5. moved this to Triaged in ACS Backlogon Oct 3, 2022
  6. Rubueno commented on Oct 3, 2022

    @Rubueno
    Contributor

    Just my 2 cents: does stopVirtualMachine with forced=true not always behave this way? The caller must know the VM is stopped before calling it: https://cloudstack.apache.org/api/apidocs-4.17/apis/stopVirtualMachine.html

  7. Hudratronium commented on Oct 3, 2022

    @Hudratronium

    Force stop the VM (vm is marked as Stopped even when command fails to be send to the backend, otherwise a force poweroff is attempted). The caller knows the VM is stopped.

    Guess the 'interesting' part is, that there is no further feedback what actually happend while calling the function. In the end that could lead to some nasty situations...
    As a 'user' i would expect that, like @weizhouapache descriped it, the VM will be stopped on the host by any means and / or verified that it is stopped. If this isn't possible, cause the agent isn't up or not reachable, i would expect this to throw a 'error'.
    I can see why such a function (override of a VM status in DB to be able to deploy it on another host if it is lost) might be usefull. But the overall nameing of the function makes me expect something different then the description in the API docs.

  8. Rubueno commented on Oct 3, 2022

    @Rubueno
    Contributor

    Indeed. My team has opened #6629 to prevent regular users from using this parameter.

  9. SakshiT25 commented on Oct 9, 2022

    @SakshiT25

    Hi, I'm interested in working on this issue. Kindly guide me for the further steps.

  10. DaanHoogland commented on Oct 11, 2022

    @DaanHoogland
    Contributor

    Indeed. My team has opened #6629 to prevent regular users from using this parameter.

    @Rubueno your request makes sense, and maybe this option should be named forceMark, markDeleted or just mark. It is forcing the marking as deleted in the DB and doesn´t force anything on the backend.

  11. DaanHoogland commented on Oct 11, 2022

    @DaanHoogland
    Contributor

    Hi, I'm interested in working on this issue. Kindly guide me for the further steps.

    @SakshiT25 see #5686 (comment)

  12. 5 remaining items

  13. DaanHoogland commented on Jun 22, 2023

    @DaanHoogland
    Contributor

    definition of force stop is being discussed here!

  14. yadvr commented on Aug 3, 2023

    @yadvr
    Member

    I think this is by design, we also have a force remove host; we leave upto the admin what they're trying to do - perhaps warn the admin/user what force stop does (in case of KVM)?

  15. moved this to Daan's Rota3 List in ACS Backlogon Aug 14, 2023
  16. linked a pull request that will close this issueapi: Force-stop descriptions #7866on Aug 15, 2023
  17. weizhouapache commented on Aug 25, 2023

    @weizhouapache
    MemberAuthor

    this is an expected behaviour

    according to #7866 made by @DaanHoogland , Force-stop VM means Force stop the VM (vm is marked as Stopped even when command fails to be send to the backend, otherwise a force poweroff is attempted). To be used if the caller knows the VM is stopped and should be marked as such.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions