Skip to content

feat: enable migrate to be dry run#4

Closed
ale8k wants to merge 2 commits into
3.6from
3.6-migrate-dry-run
Closed

feat: enable migrate to be dry run#4
ale8k wants to merge 2 commits into
3.6from
3.6-migrate-dry-run

Conversation

@ale8k

@ale8k ale8k commented Nov 21, 2025

Copy link
Copy Markdown
Owner

Enables juju migrate to be dry run. This runs the migrate command up until the final InitiateMigration call, ensuring pre-checks pass.

Checklist

  • Code style: imports ordered, good names, simple structure, etc
  • Comments saying why design decisions were made
  • Go unit tests, with comments saying what you're testing
  • Integration tests, with comments saying what you're testing
  • doc.go added or updated in changed packages

QA steps

juju bootstrap lxd dryrun
juju add-model test
juju deploy ubuntu --constraints="arch=arm64"
juju bootstrap lxd dryrun-2
juju switch dryrun
juju migrate test dryrun-2 --dry-run=true

I haven't QA'd a precheck failure but I think it'll be ok as it is covered by the tests.

Links

Launchpad bug: https://bugs.launchpad.net/juju/+bug/

Jira card: JUJU-

Enables migrate being dry run. This runs the migrate command up until the final InitiateMigration
call, ensuring pre-checks pass.

@kian99 kian99 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Looks good, thanks!

@luci1900 luci1900 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Looks fine.

Possibly more testing that necessary.

@ale8k ale8k closed this Apr 16, 2026
ale8k pushed a commit that referenced this pull request Jul 10, 2026
Addresses code review findings:

1. Issue #1 - Enforce Azure's /64 IPv6 subnet requirement:
   - validateIPFamilyForCreate now parses CIDR prefixes to verify both
     the address family (IPv6) AND the exact prefix length (/64).
   - Azure requires IPv6 subnets to be exactly /64 in size; the prior
     check only verified address type, allowing non-/64 IPv6 prefixes
     through (e.g. fd00::/56), which would later fail at Azure's API
     with a cryptic error. Now fails fast during precheck/creation.
   - Added net import to support CIDR parsing.
   - Added regression test TestStartInstanceIPFamilyDualPlacementNon64IPv6Subnet
     to guard against accepting invalid IPv6 prefix lengths.

2. Issue #4 - Remove unreachable SKU warning:
   - Deleted warning branch at line 974-977 that checked if SKU != Standard
     during dual-stack IPv6 PIP creation. This branch was unreachable because
     validateIPFamilyForCreate rejects Basic SKU earlier, leaving Standard
     as the only possible value at this point.

All tests pass including the new regression test.
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