def __init__(self):
        """Define all the parameters required by this module"""

        self.module_params = get_powermax_gatherfacts_parameters()
        self.module = AnsibleModule(argument_spec=self.module_params,
                                    supports_check_mode=True)
        serial_no = self.module.params['serial_no']
        if HAS_PYU4V is False:
            self.module.fail_json(msg="Ansible modules for PowerMax require "
                                  "the PyU4V python library to be "
                                  "installed. Please install the library "
                                  "before using these modules.")
        if PYU4V_VERSION_CHECK is not None:
            self.module.fail_json(msg=PYU4V_VERSION_CHECK)
            LOG.error(PYU4V_VERSION_CHECK)

        if serial_no is '':
            self.u4v_unisphere_con = utils.get_u4v_unisphere_connection(
                self.module.params)
            self.common = self.u4v_unisphere_con.common
            LOG.info("Got PyU4V Unisphere instance for common lib method "
                     "access on VMAX")
        else:
            self.module_params.update(
                utils.get_powermax_management_host_parameters())
            self.u4v_conn = utils.get_U4V_connection(self.module.params)
            self.provisioning = self.u4v_conn.provisioning
            self.u4v_conn.set_array_id(serial_no)
            LOG.info('Got PyU4V instance for provisioning on to VMAX ')
    def __init__(self):
        """ Define all the parameters required by this module"""
        self.module_params = utils.get_powermax_management_host_parameters()
        self.module_params.update(get_powermax_port_parameters())
        # initialize the ansible module
        self.module = AnsibleModule(argument_spec=self.module_params,
                                    supports_check_mode=False)
        # result is a dictionary that contains changed status and port details
        self.result = {"changed": False, "port_details": {}}
        if HAS_PYU4V is False:
            self.module.fail_json(msg="Ansible modules for PowerMax require "
                                  "the PyU4V python library to be "
                                  "installed. Please install the library "
                                  "before using these modules.")

        if PYU4V_VERSION_CHECK is not None:
            self.module.fail_json(msg=PYU4V_VERSION_CHECK)
            LOG.error(PYU4V_VERSION_CHECK)

        universion_details = utils.universion_check(
            self.module.params['universion'])
        LOG.info("universion_details: {0}".format(universion_details))

        if not universion_details['is_valid_universion']:
            self.module.fail_json(msg=universion_details['user_message'])

        # Getting PyU4V instance for provisioning on to VMAX
        self.u4v_conn = utils.get_U4V_connection(
            self.module.params, application_type=APPLICATION_TYPE)
        self.provisioning = self.u4v_conn.provisioning
        LOG.info("Got PyU4V instance for provisioning on to VMAX")
    def __init__(self):
        ''' Define all parameters required by this module'''
        self.module_params = utils.get_powermax_management_host_parameters()
        self.module_params.update(self.get_powermax_host_parameters())
        # initialize the ansible module
        self.module = AnsibleModule(argument_spec=self.module_params,
                                    supports_check_mode=False)
        # result is a dictionary that contains changed status and host details
        self.result = {"changed": False, "host_details": {}}
        if HAS_PYU4V is False:
            self.module.fail_json(msg="Ansible modules for PowerMax require "
                                  "the PyU4V python library to be "
                                  "installed. Please install the library "
                                  "before using these modules.")

        if PYU4V_VERSION_CHECK is not None:
            self.module.fail_json(msg=PYU4V_VERSION_CHECK)
            LOG.error(PYU4V_VERSION_CHECK)

        universion_details = utils.universion_check(
            self.module.params['universion'])
        LOG.info("universion_details: {0}".format(universion_details))

        if not universion_details['is_valid_universion']:
            self.module.fail_json(msg=universion_details['user_message'])

        self.u4v_conn = utils.get_U4V_connection(
            self.module.params, application_type=APPLICATION_TYPE)
        self.provisioning = self.u4v_conn.provisioning
        self.host_flags_list = {
            'volume_set_addressing', 'environ_set', 'disable_q_reset_on_ua',
            'openvms', 'avoid_reset_broadcast', 'scsi_3',
            'spc2_protocol_version', 'scsi_support1'
        }
        LOG.info('Got PyU4V instance for provisioning on PowerMax ')
Exemplo n.º 4
0
    def __init__(self):
        """Define all the parameters required by this module"""
        self.module_params = utils.get_powermax_management_host_parameters()
        self.module_params.update(get_powermax_snapshot_parameters())

        # initialize the Ansible module
        self.module = AnsibleModule(argument_spec=self.module_params,
                                    supports_check_mode=False)

        if HAS_PYU4V is False:
            self.module.fail_json(msg="Ansible modules for PowerMax require "
                                  "the PyU4V python library to be "
                                  "installed. Please install the library "
                                  "before using these modules.")

        if PYU4V_VERSION_CHECK is not None:
            self.module.fail_json(msg=PYU4V_VERSION_CHECK)
            LOG.error(PYU4V_VERSION_CHECK)

        universion_details = utils.universion_check(
            self.module.params['universion'])
        LOG.info("universion_details: {0}".format(universion_details))

        if not universion_details['is_valid_universion']:
            self.module.fail_json(msg=universion_details['user_message'])

        self.u4v_conn = utils.get_U4V_connection(
            self.module.params, application_type=APPLICATION_TYPE)
        self.replication = self.u4v_conn.replication
        self.common = self.u4v_conn.common
        LOG.info('Got PyU4V instance for provisioning on PowerMax ')
Exemplo n.º 5
0
    def __init__(self):
        """ Define all parameters required by this module"""
        self.module_params = utils.get_powermax_management_host_parameters()
        self.module_params.update(get_powermax_volume_parameters())

        # initialize the ansible module
        self.module = AnsibleModule(
            argument_spec=self.module_params,
            supports_check_mode=True
        )

        # result is a dictionary that contains changed status and
        # volume details
        self.result = {"changed": False, "volume_details": {}}
        if HAS_PYU4V is False:
            self.module.fail_json(msg="Ansible modules for PowerMax require "
                                      "the PyU4V python library to be "
                                      "installed. Please install the library "
                                      "before using these modules.")

        if PYU4V_VERSION_CHECK is not None:
            self.module.fail_json(msg=PYU4V_VERSION_CHECK)
            LOG.error(PYU4V_VERSION_CHECK)

        self.u4v_conn = utils.get_U4V_connection(self.module.params)
        self.provisioning = self.u4v_conn.provisioning
        LOG.info('Got PyU4V instance for provisioning on to VMAX ')
Exemplo n.º 6
0
    def __init__(self):
        ''' Define all parameters required by this module'''
        self.module_params = utils.get_powermax_management_host_parameters()
        self.module_params.update(self.get_powermax_srdf_pair_parameters())
        # initialize the ansible module
        self.module = AnsibleModule(
            argument_spec=self.module_params,
            supports_check_mode=False
        )
        # result is a dictionary that contains changed status, srdf_link
        # and job details
        self.result = {
            "changed": False,
            "SRDF_link_details": {},
            "Job_details": {}}
        if HAS_PYU4V is False:
            self.module.fail_json(msg="Ansible modules for PowerMax require "
                                      "the PyU4V python library to be "
                                      "installed. Please install the library "
                                      "before using these modules.")

        if PYU4V_VERSION_CHECK is not None:
            self.module.fail_json(msg=PYU4V_VERSION_CHECK)
            LOG.error(PYU4V_VERSION_CHECK)

        universion_details = utils.universion_check(
                             self.module.params['universion'])
        LOG.info("universion_details: {0}".format(universion_details))

        if not universion_details['is_valid_universion']:
            self.module.fail_json(msg=universion_details['user_message'])

        self.u4v_conn = utils.get_U4V_connection(
            self.module.params, application_type=APPLICATION_TYPE)
        self.replication = self.u4v_conn.replication
        LOG.info('Got PyU4V instance for replication on PowerMax ')
        self.idempotency_dict = {
            'Synchronized': ['Establish', 'Resume'],
            'Consistent': ['Establish', 'Resume'],
            'Suspended': ['Suspend', 'Failover'],
            'Failed Over': ['Suspend', 'Failover'],
            'SyncInProg': ['Establish', 'Resume'],
        }
        
        self.idempotency_dict_metro = {
            'Suspended': ['Suspend'],
            'SyncInProg': ['Establish'],
            'ActiveActive': ['Establish'],
            'ActiveBias': ['Establish']
        }
Exemplo n.º 7
0
    def __init__(self):
        """Define all the parameters required by this module"""
        self.module_params = utils.get_powermax_management_host_parameters()
        self.module_params.update(get_powermax_storage_group_parameters())

        # initialize the Ansible module
        self.module = AnsibleModule(argument_spec=self.module_params,
                                    supports_check_mode=True)
        if HAS_PYU4V is False:
            self.module.fail_json(msg="Ansible modules for PowerMax require "
                                  "the PyU4V python library to be "
                                  "installed. Please install the library "
                                  "before using these modules.")
        if PYU4V_VERSION_CHECK is not None:
            self.module.fail_json(msg=PYU4V_VERSION_CHECK)
            LOG.error(PYU4V_VERSION_CHECK)

        self.u4v_conn = utils.get_U4V_connection(self.module.params)
        self.provisioning = self.u4v_conn.provisioning
        LOG.info('Got PyU4V instance for provisioning on PowerMax ')
Exemplo n.º 8
0
    def __init__(self):
        """Define all the parameters required by this module"""

        self.module_params = get_powermax_gatherfacts_parameters()
        self.module = AnsibleModule(argument_spec=self.module_params,
                                    supports_check_mode=False)
        serial_no = self.module.params['serial_no']
        if HAS_PYU4V is False:
            self.module.fail_json(msg="Ansible modules for PowerMax require "
                                  "the PyU4V python library to be "
                                  "installed. Please install the library "
                                  "before using these modules.")
        if PYU4V_VERSION_CHECK is not None:
            self.module.fail_json(msg=PYU4V_VERSION_CHECK)
            LOG.error(PYU4V_VERSION_CHECK)

        universion_details = utils.universion_check(
            self.module.params['universion'])
        LOG.info("universion_details: {0}".format(universion_details))

        if not universion_details['is_valid_universion']:
            self.module.fail_json(msg=universion_details['user_message'])

        if serial_no is '':
            self.u4v_unisphere_con = utils.get_u4v_unisphere_connection(
                self.module.params, APPLICATION_TYPE)
            self.common = self.u4v_unisphere_con.common
            LOG.info("Got PyU4V Unisphere instance for common lib method "
                     "access on VMAX")
        else:
            self.module_params.update(
                utils.get_powermax_management_host_parameters())
            self.u4v_conn = utils.get_U4V_connection(
                self.module.params, application_type=APPLICATION_TYPE)
            self.provisioning = self.u4v_conn.provisioning
            self.u4v_conn.set_array_id(serial_no)
            LOG.info('Got PyU4V instance for provisioning on to PowerMax ')
            self.replication = self.u4v_conn.replication
            LOG.info('Got PyU4V instance for replication on to PowerMax ')