https://github.com/nutanixdev/move_vms_from_pd_to_category
Project in progress with Dwayne Lessner - please DO NOT modify
https://github.com/nutanixdev/move_vms_from_pd_to_category
Last synced: 11 months ago
JSON representation
Project in progress with Dwayne Lessner - please DO NOT modify
- Host: GitHub
- URL: https://github.com/nutanixdev/move_vms_from_pd_to_category
- Owner: nutanixdev
- Created: 2019-10-29T00:57:47.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2021-03-22T07:21:17.000Z (about 5 years ago)
- Last Synced: 2025-03-16T19:59:04.551Z (about 1 year ago)
- Language: Python
- Size: 469 KB
- Stars: 0
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.rst
Awesome Lists containing this project
README
==========================================
Move VM from Protection Domain to Category
==========================================
- Use included params.json as API request parameters
- List all VMs that are entities within an existing Protection Domain
- Remove those VMs from an existing Protection Domain
- Assign the same VMs to an existing category
---------------
Important Notes
---------------
- This script has been written for demo purposes only. *Please* make sure to add appropriate error-checking and exception handling before using it in production.
- For use in production it would advisable to add checks for making the PD and Category exist.
------------
Requirements
------------
- Python >=3.6 (lower versions will NOT work)
- pip3 (for dependencies installation)
- Tested on Python 3.6, 3.7 and 3.8
-----
Usage
-----
- Clone repo to your local machine
- Setup a virtual environment on Linux or Mac (strongly recommended):
.. code-block:: python
python3.8 -m venv venv
. venv/bin/activate
- Setup a virtual environment on Windows (strongly recommended):
.. note:: See https://docs.python.org/3/library/venv.html for Windows instructions
- Install the dependencies:
.. code-block:: python
pip3 install -e .
- Adjust values in **params.json** to match your Prism Element, Prism Central, Protection Domain and category settings
- Run the script:
.. code-block:: python
python3.8 move_vms.py params.json
----------
Screenshot
----------
An example of the script running is shown below.
.. figure:: ./screenshot.png