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

Support for generalizing VMs #49704

Merged
merged 9 commits into from Dec 10, 2018

Conversation

zikalino
Copy link
Contributor

@zikalino zikalino commented Dec 10, 2018

SUMMARY

This PR extends current VM to support generalization.

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

azure_rm_virtualmachine
azure_rm_virtualmachine_facts

ADDITIONAL INFORMATION

@ansibot
Copy link
Contributor

ansibot commented Dec 10, 2018

@ansibot ansibot added affects_2.8 This issue/PR affects Ansible v2.8 azure cloud community_review In order to be merged, this PR must follow the community review workflow. feature This issue/PR relates to a feature request. module This issue/PR relates to a module. needs_triage Needs a first human triage before being processed. owner_pr This PR is made by the module's maintainer. support:community This issue/PR relates to code supported by the Ansible community. labels Dec 10, 2018
@ansibot ansibot removed the owner_pr This PR is made by the module's maintainer. label Dec 10, 2018
@@ -68,6 +68,12 @@
- Toggle that controls if the machine is allocated/deallocated, only useful with state='present'.
default: True
type: bool
generalized:
Copy link
Contributor

Choose a reason for hiding this comment

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

why 'd'?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it follows other options, which are "started", "stopped".... etc....

@@ -1343,6 +1359,9 @@ def serialize_vm(self, vm):
if vm.instance_view:
result['powerstate'] = next((s.code.replace('PowerState/', '')
for s in vm.instance_view.statuses if s.code.startswith('PowerState')), None)
for s in vm.instance_view.statuses:
if s.code == "OSState/generalized":
Copy link
Contributor

Choose a reason for hiding this comment

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

lower case to avoid case sensitive?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok, won't hurt

@ansibot ansibot removed the needs_triage Needs a first human triage before being processed. label Dec 10, 2018
generalized:
description:
- Use with state 'present' to generalize the machine. Set to true to generalize the machine.
- Please note that this operation is irreversible.
Copy link
Contributor

Choose a reason for hiding this comment

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

i think we need stronger message to user, that once generalized, the vm is not usable.

@zikalino zikalino merged commit b89eb7a into ansible:devel Dec 10, 2018
@zikalino zikalino deleted the vm-facts-return-generalized-state branch December 10, 2018 08:21
kbreit pushed a commit to kbreit/ansible that referenced this pull request Jan 11, 2019
@ansible ansible locked and limited conversation to collaborators Jul 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.8 This issue/PR affects Ansible v2.8 azure cloud community_review In order to be merged, this PR must follow the community review workflow. feature This issue/PR relates to a feature request. module This issue/PR relates to a module. support:community This issue/PR relates to code supported by the Ansible community.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants