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

Update VM IP after restore replace #1472

Merged

Conversation

albinsun
Copy link
Contributor

@albinsun albinsun commented Aug 26, 2024

Which issue(s) this PR fixes:

Issue #1462

What this PR does / why we need it:

  1. Fix test_restore_replace_with_vm_shutdown_command due to VM IP is not update after restore place.
  2. After restore replace, wait VM Running to avoid unexpectedly start a Restoring/Stopped VM.

Special notes for your reviewer:

n/a

Additional documentation or context

  • Before (harvester-runtests/86)
    image

  • After (harvester-runtests/89)
    image

endtime = datetime.now() + timedelta(seconds=wait_timeout)
while endtime > datetime.now():
code, data = api_client.vms.get(unique_vm_name)
if 200 == code and "Running" == data.get('status', {}).get('printableStatus'):
Copy link
Member

@lanfon72 lanfon72 Aug 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel that we can implement wait_status_running as the wait_status_stopped does.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Refactored in commit 58f5535.

@albinsun albinsun requested a review from lanfon72 August 28, 2024 01:39
Copy link
Member

@lanfon72 lanfon72 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@khushboo-rancher khushboo-rancher merged commit ba771f7 into harvester:main Aug 28, 2024
4 checks passed
@albinsun albinsun deleted the fix_test_4_vm_backup_restore branch August 29, 2024 00:58
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.

3 participants