Skip to content

BUG: Skip any migration or snapshot steps if we're in an invalid state#461

Merged
jose-caballero merged 1 commit into
add_flag_live_migrationfrom
check_before_attempting_migration
Jul 1, 2026
Merged

BUG: Skip any migration or snapshot steps if we're in an invalid state#461
jose-caballero merged 1 commit into
add_flag_live_migrationfrom
check_before_attempting_migration

Conversation

@DavidFair

@DavidFair DavidFair commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator

Description:

Skips any migration steps, as we would previously take a snapshot - force the user to wait for multiple hours then fail when we knew up-front it wouldn't work.

Instead provide rapid feedback that we can't do an error state or we can't migrate before doing any work

TODO: test this works on dev once #459 is merged

Special Notes:


Submitter:

Have you (where applicable):

  • Added unit tests?
  • Checked the latest commit runs on Dev?
  • Updated the example config file(s) and README?

Reviewer

Does this PR:

  • Place non-StackStorm code into the lib directory?
  • Have unit tests for the action/sensor and lib layers?
  • Have clear and obvious action parameter names and descriptions?

Skips any migration steps, as we would previously take a snapshot - force the user
to wait for multiple hours then fail when we knew up-front it wouldn't work.

Instead provide rapid feedback that we can't do an error state or we can't migrate
before doing any work
@DavidFair DavidFair force-pushed the check_before_attempting_migration branch from 506e787 to eeaf104 Compare July 1, 2026 09:28
@codecov

codecov Bot commented Jul 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.19%. Comparing base (5e00a96) to head (eeaf104).

Additional details and impacted files
@@                   Coverage Diff                    @@
##           add_flag_live_migration     #461   +/-   ##
========================================================
  Coverage                    99.19%   99.19%           
========================================================
  Files                          112      112           
  Lines                         2737     2739    +2     
  Branches                       339      340    +1     
========================================================
+ Hits                          2715     2717    +2     
  Misses                          19       19           
  Partials                         3        3           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@DavidFair DavidFair mentioned this pull request Jul 1, 2026
6 tasks
@jose-caballero jose-caballero marked this pull request as ready for review July 1, 2026 09:49
@DavidFair

Copy link
Copy Markdown
Collaborator Author

Now correctly skips all steps if we attempt to do it with an error:

st2.actions.python.OpenstackActions: DEBUG    with Parameters: server_id: 4dbe774a-b036-4b1c-8323-ad167df31cbe
live_migration: False
cloud_account: dev
dest_host: None
snapshot: True
Traceback (most recent call last):
  File "/opt/stackstorm/st2/lib/python3.10/site-packages/python_runner/python_action_wrapper.py", line 397, in <module>
    obj.run()
  File "/opt/stackstorm/st2/lib/python3.10/site-packages/python_runner/python_action_wrapper.py", line 216, in run
    output = action.run(**self._parameters)
  File "/opt/stackstorm/packs/stackstorm_openstack/actions/src/openstack_actions.py", line 34, in run
    return action_func(**kwargs)
  File "/opt/stackstorm/packs/stackstorm_openstack/lib/apis/openstack_api/openstack_server.py", line 88, in snapshot_and_migrate_server
    raise ValueError(
ValueError: Server status: ERROR. The server must be ACTIVE or SHUTOFF to be migrated
"
  stdout: ''

@jose-caballero jose-caballero merged commit dca5f0a into add_flag_live_migration Jul 1, 2026
12 checks passed
@jose-caballero jose-caballero deleted the check_before_attempting_migration branch July 1, 2026 09:50
@DavidFair DavidFair restored the check_before_attempting_migration branch July 1, 2026 09:51
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.

2 participants