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

VMware: standardized states between 'vmware_guest' & 'vmware_guest_powerstate' #56187

Open
wants to merge 1 commit into
base: devel
from

Conversation

Projects
None yet
4 participants
@dericcrago
Copy link
Contributor

commented May 7, 2019

standardized states between vmware_guest & vmware_guest_powerstate

SUMMARY

Fixes #55653

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

vmware_guest

ADDITIONAL INFORMATION

See #55653

# example deprecation warnings

[DEPRECATION WARNING]: the use of 'poweredoff' is deprecated, please switch to the new format, 'powered-off'). This feature will be removed in version 2.13. Deprecation 
warnings can be disabled by setting deprecation_warnings=False in ansible.cfg.

[DEPRECATION WARNING]: the use of 'poweredon' is deprecated, please switch to the new format, 'powered-on'). This feature will be removed in version 2.13. Deprecation 
warnings can be disabled by setting deprecation_warnings=False in ansible.cfg.

[DEPRECATION WARNING]: the use of 'rebootguest' is deprecated, please switch to the new format, 'reboot-guest'). This feature will be removed in version 2.13. 
Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg.

[DEPRECATION WARNING]: the use of 'shutdownguest' is deprecated, please switch to the new format, 'shutdown-guest'). This feature will be removed in version 2.13. 
Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg.
@ansibot

This comment has been minimized.

@ansibot

This comment has been minimized.

Copy link
Contributor

commented May 7, 2019

@dericcrago, just so you are aware we have a dedicated Working Group for vmware.
You can find other people interested in this in #ansible-vmware on Freenode IRC
For more information about communities, meetings and agendas see https://github.com/ansible/community

click here for bot help

@dericcrago dericcrago force-pushed the dericcrago:55653 branch from 34e51b1 to 6e75f18 May 7, 2019

@@ -49,25 +49,25 @@
configurations conforms to task arguments.'
- 'If C(state) is set to C(absent) and virtual machine exists, then the specified virtual machine
is removed with its associated components.'
- 'If C(state) is set to one of the following C(poweredon), C(poweredoff), C(present), C(restarted), C(suspended)
- 'If C(state) is set to one of the following C(powered-off), C(powered-on), C(present), C(restarted), C(suspended)

This comment has been minimized.

Copy link
@Akasurde

Akasurde May 15, 2019

Member
Suggested change
- 'If C(state) is set to one of the following C(powered-off), C(powered-on), C(present), C(restarted), C(suspended)
- 'If C(state) is set to one of the following C(poweredoff), C(poweredon), C(powered-off), C(powered-on), C(present), C(restarted), C(suspended)
- 'If C(state) is set to C(poweredon) and virtual machine exists with powerstate other than powered on,
then the specified virtual machine is powered on.'
- 'If C(state) is set to C(poweredoff) and virtual machine exists with powerstate other than powered off,
- 'If C(state) is set to C(powered-off) and virtual machine exists with powerstate other than powered off,

This comment has been minimized.

Copy link
@Akasurde

Akasurde May 15, 2019

Member
Suggested change
- 'If C(state) is set to C(powered-off) and virtual machine exists with powerstate other than powered off,
- 'If C(state) is set to C(powered-off) or C(poweredoff) and virtual machine exists with powerstate other than powered off,
then the specified virtual machine is powered off.'
- 'If C(state) is set to C(powered-on) and virtual machine exists with powerstate other than powered on,

This comment has been minimized.

Copy link
@Akasurde

Akasurde May 15, 2019

Member
Suggested change
- 'If C(state) is set to C(powered-on) and virtual machine exists with powerstate other than powered on,
- 'If C(state) is set to C(powered-on) or C(poweredon) and virtual machine exists with powerstate other than powered on,
then the specified virtual machine is powered off.'
- 'If C(state) is set to C(powered-on) and virtual machine exists with powerstate other than powered on,
then the specified virtual machine is powered on.'
- 'If C(state) is set to C(reboot-guest) and virtual machine exists, then the virtual machine is rebooted.'

This comment has been minimized.

Copy link
@Akasurde

Akasurde May 15, 2019

Member
Suggested change
- 'If C(state) is set to C(reboot-guest) and virtual machine exists, then the virtual machine is rebooted.'
- 'If C(state) is set to C(reboot-guest) or C(rebootguest) and virtual machine exists, then the virtual machine is rebooted.'
- 'If C(state) is set to C(restarted) and virtual machine exists, then the virtual machine is restarted.'
- 'If C(state) is set to C(shutdown-guest) and virtual machine exists, then the virtual machine is shutdown.'

This comment has been minimized.

Copy link
@Akasurde

Akasurde May 15, 2019

Member
Suggested change
- 'If C(state) is set to C(shutdown-guest) and virtual machine exists, then the virtual machine is shutdown.'
- 'If C(state) is set to C(shutdown-guest) or C(shutdownguest) and virtual machine exists, then the virtual machine is shutdown.'
name:
description:
- Name of the virtual machine to work with.
- Virtual machine names in vCenter are not necessarily unique, which may be problematic, see C(name_match).
- 'If multiple virtual machines with same name exists, then C(folder) is required parameter to
identify uniqueness of the virtual machine.'
- This parameter is required, if C(state) is set to C(poweredon), C(poweredoff), C(present), C(restarted), C(suspended)
- This parameter is required, if C(state) is set to C(powered-off), C(powered-on), C(present), C(restarted), C(suspended)

This comment has been minimized.

Copy link
@Akasurde

Akasurde May 15, 2019

Member
Suggested change
- This parameter is required, if C(state) is set to C(powered-off), C(powered-on), C(present), C(restarted), C(suspended)
- This parameter is required, if C(state) is set to C(poweredoff), C(poweredon), C(powered-off), C(powered-on), C(present), C(restarted), C(suspended)
@@ -223,8 +223,8 @@
version_added: '2.8'
state_change_timeout:
description:
- If the C(state) is set to C(shutdownguest), by default the module will return immediately after sending the shutdown signal.
- If this argument is set to a positive integer, the module will instead wait for the virtual machine to reach the poweredoff state.
- If the C(state) is set to C(shutdown-guest), by default the module will return immediately after sending the shutdown signal.

This comment has been minimized.

Copy link
@Akasurde

Akasurde May 15, 2019

Member
Suggested change
- If the C(state) is set to C(shutdown-guest), by default the module will return immediately after sending the shutdown signal.
- If the C(state) is set to C(shutdown-guest) or C(shutdownguest), by default the module will return immediately after sending the shutdown signal.
@@ -855,7 +855,7 @@ def gather_facts(self, vm):

def remove_vm(self, vm):
# https://www.vmware.com/support/developer/converter-sdk/conv60_apireference/vim.ManagedEntity.html#destroy
if vm.summary.runtime.powerState.lower() == 'poweredon':
if vm.summary.runtime.powerState.lower() == 'powered-on':

This comment has been minimized.

Copy link
@Akasurde

Akasurde May 15, 2019

Member
Suggested change
if vm.summary.runtime.powerState.lower() == 'powered-on':
if vm.summary.runtime.powerState.lower() in ['poweredon', 'powered-on']:

@Akasurde Akasurde changed the title standardized states between 'vmware_guest' & 'vmware_guest_powerstate' VMware: standardized states between 'vmware_guest' & 'vmware_guest_powerstate' May 15, 2019

@Akasurde Akasurde removed the needs_triage label May 15, 2019

msg="the use of '{0}' is deprecated, please switch to the new format, '{1}')".format(deprecated_state, module.params['state']),
version='2.13'
)

This comment has been minimized.

Copy link
@dericcrago

dericcrago May 15, 2019

Author Contributor

Hi @Akasurde - Thanks for reviewing this PR. I was deprecating the old style and converting it to the new style. That was why I left out the old style (with the dash) from both the docs and the code.

This comment has been minimized.

Copy link
@Akasurde

Akasurde May 16, 2019

Member

Yes, we will remove old style while remove it all together. Let me know if it works for you.

This comment has been minimized.

Copy link
@dericcrago

dericcrago May 23, 2019

Author Contributor

Hi @Akasurde - based on that (deprecating the old style) do we need all of the suggested changes above? As the PR stands, docs will no longer mention the old style, and if you use the old style you will get a deprecation warning and it will be immediately converted to the new style (see the block this comment started on) so that we don't need to check for both styles later on.

This comment has been minimized.

Copy link
@goneri

goneri May 23, 2019

Contributor

Hi @dericcrago, I'm not sure I fully understand your message. What do you mean by "other changes above".

This comment has been minimized.

Copy link
@dericcrago

dericcrago May 23, 2019

Author Contributor

sorry @goneri & @Akasurde - that was confusing, I just fixed my comment, I meant "suggested changes above".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.