Skip to content

vmware: add vm_status_on_create and vm_status_preserve - #563

Merged
semx merged 2 commits into
developmentfrom
feature/vm-status-options
Sep 9, 2026
Merged

semx merged 2 commits into
developmentfrom
feature/vm-status-options

Conversation

@semx

@semx semx commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator

Closes #528 by @eric-eisenhart, commits are his. Also covers #458.

Both options are useful and the implementation is his, including the parsing and the validation against the allowed NetBox statuses. The only thing I changed is the defaults: he shipped them as active and planned, staged, decommissioning, which would have changed every existing installation on upgrade - a powered-off VM would have been created as active, and three statuses would silently stop following the power state. Both are unset now, so nothing happens unless you configure them, and the example config says so.

Had to resolve one conflict in connection.py, his status block landed next to the device-type guard from #556. Both kept.

tests/test_vmware_vm_status_options.py covers the default path for new and existing VMs, both options doing their job when set, and that a config which does not mention them parses to unset - that last one fails if the defaults come back. Suite 120.

eric-eisenhart and others added 2 commits July 23, 2026 17:39
vm_status_on_create (default: active) defines the status a VM gets
assigned when netbox-sync creates it as a new NetBox VM. The default
matches previous behavior in practice, since offline VMs are skipped
on the first parsing pass and newly created VMs were therefore always
powered on and set to 'active'.

vm_status_preserve (default: planned, staged, decommissioning) defines
a list of NetBox VM statuses which are never changed on updates. This
prevents power-state syncing from silently reverting human-set
lifecycle states like 'planned' or 'staged' to 'active'. Set to an
empty value to always update the VM status (previous behavior).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
(cherry picked from commit a64bdaa)
@semx
semx requested a review from bb-Ricardo as a code owner September 9, 2026 23:20
@semx
semx merged commit ce3dc23 into development Sep 9, 2026
1 check passed
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