Skip to content

Conversation

@alexbleotu
Copy link
Contributor

@alexbleotu alexbleotu commented Sep 21, 2017

What does this PR do?

Added a vCenter specific proxy and the functions required to configure storage policies (previously known as storage profiles) on the vCenter. This requires to connect to a different endpoint called /pbm which names the state and utils modules. The execution function is vsphere

Examples of the input expected to configure a storage policy can be found in the sysdoc of salt.states.pbm.

List of functions:
Proxy:

  • all required functions to run the vcenter proxy
  • some existing functions and tests in the vsphere module have been adjusted to support the new proxy

Utils functions

  • get_new_service_instance_stub that creates a new service instance stub
  • salt.utils.pbm.get_profile_manager
  • salt.utils.pbm.get_placement_solver
  • salt.utils.pbm.get_capability_definitions
  • salt.utils.pbm.get_policies_by_id
  • salt.utils.pbm.get_storage_policies
  • salt.utils.pbm.create_storage_policy
  • salt.utils.pbm.create_storage_policy
  • salt.utils.pbm.update_storage_policy
  • salt.utils.pbm.get_default_storage_policy_of_datastore
  • salt.utils.pbm.assign_default_storage_policy_to_datastore

Execution functions:

  • salt.modules.vsphere._get_policy_dict that transforms a policy VMware object into a dict representation
  • salt.modules.vsphere.list_storage_policies that retrieves dict representations of storage policies, filtered by name
  • salt.modules.vsphere.list_default_vsan_policy that retrieves dict representation of the default storage policies
  • salt.modules.vsphere._get_capability_definition_dict that transforms a VMware capability definition into a dict representation
  • salt.modules.vsphere.list_capability_definitions that returns dict representations of VMware capability definition
  • salt.modules.vsphere._apply_policy_config that applies a storage dict representations values to a object
  • salt.modules.vsphere.create_storage_policy
  • salt.modules.vsphere.update_storage_policy
  • salt.modules.vsphere.list_default_storage_policy_of_datastore that lists the dict representation of the policy assigned by default to a datastore
  • salt.modules.vsphere.assign_default_storage_policy_to_datastore

States functions:

  • salt.states.pbm.default_vsan_policy_configured state that configures the default storage policy
  • salt.states.pbm.storage_policies_configured state that creates/configures storage policies
  • salt.states.pbm.default_storage_policy_assigned state that manages default storage policies to datastore assigments

Tests written?

Yes (for utils functions)

Please review Salt's Contributing Guide for best practices.

@ghost
Copy link

ghost commented Sep 21, 2017

@alexbleotu, thanks for your PR! By analyzing the history of the files in this pull request, we identified @rallytime, @cro and @s0undt3ch to be potential reviewers.

@alexbleotu
Copy link
Contributor Author

alexbleotu commented Sep 21, 2017

The state functions use some shared methods in #43645 so that needs to be merged in first

@cachedout
Copy link
Contributor

@alexbleotu I got #43645 in but there are some merge conflicts now. Could you please resolve them? Thanks.

@alexbleotu
Copy link
Contributor Author

alexbleotu commented Sep 22, 2017

@cachedout rebased and added the pyVmomi incompatibility check. Also #43604

LE: Some tests are fixed in #43604. They will fail here until the other branch is merged.

Alexandru Bleotu added 24 commits September 25, 2017 18:18
…representations of storage policies, filtered by name
Copy link
Contributor

@rallytime rallytime left a comment

Choose a reason for hiding this comment

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

Very well done!

@rallytime rallytime requested a review from cachedout September 26, 2017 14:03
@alexbleotu
Copy link
Contributor Author

Can we get this merged in? I really need to get both this PR and #43751 (afterwards please) merged in today or tomorrow. Thanks!

@rallytime
Copy link
Contributor

re-run py3

@@ -1,5 +1,7 @@
# -*- coding: utf-8 -*-
'''
import sys
Copy link
Contributor

Choose a reason for hiding this comment

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

Import is in the comment block.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

# -*- coding: utf-8 -*-
'''
import sys
import ssl
Copy link
Contributor

Choose a reason for hiding this comment

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

Import is in the comment block

Copy link
Contributor Author

Choose a reason for hiding this comment

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

my bad will take them out

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@alexbleotu
Copy link
Contributor Author

@cachedout all done. Is the GPG required now?

@rallytime
Copy link
Contributor

@alexbleotu We're going to be encouraging contributors to sign their commits, but you don't need to do so retroactively.

@rallytime rallytime merged commit e4be436 into saltstack:develop Sep 27, 2017
@alexbleotu alexbleotu deleted the storage_policies-gh branch September 28, 2017 08:44
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