File manager - Edit - /opt/saltstack/salt/lib/python3.10/site-packages/salt/cloud/clouds/__pycache__/vmware.cpython-310.pyc
Back
o ;j� � @ s^ d Z ddlZddlZddlZddlZddlZddlZddlm Z ddl mZ ddlZ ddlZ ddlZ ddlZ ddlZ ddlmZ z ddlmZ dZW n eyU dZY nw zddlmZ e� W n eyj Y nw d Zd ZdZdZd ZdZdZ e�!e"�Z#dZ$dd� Z%dd� Z&dd� Z'dd� Z(dd� Z)dd� Z*dd� Z+d�dd �Z, ! d�d"d#�Z- d�d$d%�Z. d�d&d'�Z/d(d)� Z0d*d+� Z1d,d-� Z2d.d/� Z3d0d1� Z4d2d3� Z5d4d5� Z6d6d7� Z7d�d8d9�Z8d:d;� Z9d�d<d=�Z:d>d?� Z;d@dA� Z<dBdC� Z=d�dFdG�Z>dHdI� Z?dJdK� Z@d�dMdN�ZAdOdP� ZBdQdR� ZCd�dSdT�ZDdUdV� ZEd�dWdX�ZFd�dYdZ�ZGd�d[d\�ZHd�d]d^�ZId�d_d`�ZJd�dadb�ZKd�dcdd�ZLd�dedf�ZMd�dgdh�ZNd�didj�ZOd�dkdl�ZPd�dmdn�ZQd�dodp�ZRd�dqdr�ZSd�dsdt�ZTd�dudv�ZUd�dwdx�ZVd�dydz�ZWd�d{d|�ZXd�d}d~�ZYd�dd��ZZd�d�d��Z[d�d�d��Z\d�d�d��Z]d�d�d��Z^d�d�d��Z_d�d�d��Z`d�d�� Zad�d�� Zbd�d�� Zcd�d�� Zdd�d�d��Zed�d�d��Zfd�d�d��Zgd�d�d��Zhd�d�d��Zid�d�d��Zjd�d�d��Zkd�d�d��Zld�d�d��Zmd�d�d��Znd�d�d��Zod�d�d��Zpd�d�d��Zqd�d�d��Zrd�d�d��Zsd�d�d��Ztd�d�d��Zud�d�d��Zvd�d�d��Zwd�d�d��Zxd�d�d��Zyd�d�d��Zzd�d�dZ{d�d�dĄZ|d�d�dƄZ}d�d�dȄZ~dS )�aH VMware Cloud Module =================== .. versionadded:: 2015.5.4 The VMware cloud module allows you to manage VMware ESX, ESXi, and vCenter. See :ref:`Getting started with VMware <cloud-getting-started-vmware>` to get started. :codeauthor: Nitin Madhok <nmadhok@g.clemson.edu> Dependencies ============ - pyVmomi Python Module pyVmomi ------- PyVmomi can be installed via pip: .. code-block:: bash pip install pyVmomi .. note:: Version 6.0 of pyVmomi has some problems with SSL error handling on certain versions of Python. If using version 6.0 of pyVmomi, Python 2.6, Python 2.7.9, or newer must be present. This is due to an upstream dependency in pyVmomi 6.0 that is not supported in Python versions 2.7 to 2.7.8. If the version of Python is not in the supported range, you will need to install an earlier version of pyVmomi. See `Issue #29537`_ for more information. .. _Issue #29537: https://github.com/saltstack/salt/issues/29537 Based on the note above, to install an earlier version of pyVmomi than the version currently listed in PyPi, run the following: .. code-block:: bash pip install pyVmomi==5.5.0.2014.1.1 The 5.5.0.2014.1.1 is a known stable version that this original VMware cloud driver was developed against. .. note:: Ensure python pyVmomi module is installed by running following one-liner check. The output should be 0. .. code-block:: bash python -c "import pyVmomi" ; echo $? Configuration ============= To use this module, set up the vCenter or ESX/ESXi URL, username and password in the cloud configuration at ``/etc/salt/cloud.providers`` or ``/etc/salt/cloud.providers.d/vmware.conf``: .. code-block:: yaml my-vmware-config: driver: vmware user: 'DOMAIN\user' password: 'verybadpass' url: '10.20.30.40' vcenter01: driver: vmware user: 'DOMAIN\user' password: 'verybadpass' url: 'vcenter01.domain.com' protocol: 'https' port: 443 vcenter02: driver: vmware user: 'DOMAIN\user' password: 'verybadpass' url: 'vcenter02.domain.com' protocol: 'http' port: 80 esx01: driver: vmware user: 'admin' password: 'verybadpass' url: 'esx01.domain.com' .. note:: Optionally, ``protocol`` and ``port`` can be specified if the vCenter server is not using the defaults. Default is ``protocol: https`` and ``port: 443``. .. note:: .. versionchanged:: 2015.8.0 The ``provider`` parameter in cloud provider configuration was renamed to ``driver``. This change was made to avoid confusion with the ``provider`` parameter that is used in cloud profile configuration. Cloud provider configuration now uses ``driver`` to refer to the salt-cloud driver that provides the underlying functionality to connect to a cloud provider, while cloud profile configuration continues to use ``provider`` to refer to the cloud provider configuration that you define. To test the connection for ``my-vmware-config`` specified in the cloud configuration, run :py:func:`test_vcenter_connection` � N)�randint)�SaltCloudSystemExit)�vimTF)�disable_warningszVMware ESXi 5.5�� Z%moveAllDiskBackingsAndDisallowSharingZ"moveAllDiskBackingsAndAllowSharingZmoveChildMostDiskBackingZcreateNewChildDiskBackingz[^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$�vmwarec C s t � du rdS t� du rdS tS )zL Check for VMware configuration and if required libs are available. F)�get_configured_provider�get_dependencies�__virtualname__� r r �L/opt/saltstack/salt/lib/python3.10/site-packages/salt/cloud/clouds/vmware.py�__virtual__� s r c C s"