PyBenParallels
Introduction
PyBEN Parallels repository is an easy to use python utility class for Parallels server solution
Installation
python -m pip install pybenparallels
Use
Cli module activation
Run for a full help printout:
python -m pybenparallels -h
The class can be run on remote location via SSH or Locally by leaving the PARALLELS_HOST empty
- pybenparallels is the name of the module
- pprint is a function to print the returned dict nicely in console
- get_vms is a function to return all vms (or request a specific one)
Example use for LOCAL to get all vms and a specific one:
python -m pybenparallels pprint get_vms
python -m pybenparallels pprint get_vms vm_name=ventura
Example for REMOTE SERVER use of global variables to get all vms: Use PARALLELS_CLI_EXEC when you need to override the execution line to overcome ssh context restrictions.
set PARALLELS_HOST='1.1.1.1'
set PARALLELS_HOST_USER='root'
set PARALLELS_HOST_PASS='1234'
set PARALLELS_CLI_EXEC='. ~/.zprofile; prlctl'
python -m pybenparallels pprint get_vms
Example for passing variables directly for REMOTE SERVER:
- pybenparallels is the name of the module
- get_vms is a function to return all vms (or request a specific one)
python -m pybenparallels host=1.1.1.1 host_user=root host_password=1234 get_vms vm_name=ventura
Python import ProxmoxCls class
from pybenparallels import ParallelsCLI
# For remote server (connection via ssh)
server = ParallelsCLI(host='1.1.1.1', host_user='root', host_password='1234')
server.cli_exec = '. ~/.zprofile; prlctl' # Sometimes the ssh user does not have the correct python3 in PATH
print(server.get_vms())
# For local use, when you are running on the parallel server
print(ParallelsCLI().get_vms())
Some of the included functions:
- get_vms: Returns a full list of vms, or list with matching vms by uuid or name
- run_command: Execute a command on the parallels cli
- send_vm_command: prlctl exec ...
- send_vm_command_by_ssh
- create_vms
- delete_vm
- start_vm
- stop_vm
- pause_vm
- resume_vm
- snapshot handling
- and more ...
Metadata
Release files for pybenparallels 1.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pybenparallels-1.1.1.tar.gz | 6.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pybenparallels-1.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 13.3 kB
Release files / pybenparallels-1.1.1.tar.gz
| Download URL | pybenparallels-1.1.1.tar.gz |
|---|---|
| Size | 6.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1582a56c8f382be80e2c98fd699bf15113d3fb8979a71c62b3701d964e483a7e
|
|
BLAKE2b-256 checksum How to use checksums |
71c15c3081a3852f75756f6a92db99880a59bee5b9e70fa735711e20bde8d114
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.5
|
Release files / pybenparallels-1.1.1-py3-none-any.whl
| Download URL | pybenparallels-1.1.1-py3-none-any.whl |
|---|---|
| Size | 6.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
64f10d7f8e6a26223c7c1271e7b97b19bb613a257cf07d1eb70aec7976a8db53
|
|
BLAKE2b-256 checksum How to use checksums |
c544a734a74672b30f1f265893e6d9b358fa57e9c5065241a9ea536c501e1f8d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.5
|