Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how i can creeate VM with api ? #73

Open
hocineKHE opened this issue Apr 17, 2019 · 7 comments
Open

how i can creeate VM with api ? #73

hocineKHE opened this issue Apr 17, 2019 · 7 comments

Comments

@hocineKHE
Copy link

No description provided.

@elschman
Copy link

Simple..
first install the proxmoxer
seconf follow the guideline to open a session
open https://pve.proxmox.com/pve-docs/api-viewer/index.html to get knowledge about the api apth.
I guess nodes /api2/json/nodes/{node}/qemu is the one your looking for
create the api call out of this
proxmox.nodes([TARGETnode]).qemu.push(vmid=[newID])

newID must be a free one.

@hocineKHE
Copy link
Author

whene i try to run this code i have proble

> from proxmoxer import ProxmoxAPI
> proxmox = ProxmoxAPI('****', user='*****',password='****', verify_ssl=False)
> 
> for node in proxmox.nodes.get():
>     for vm in proxmox.nodes(node['node']).openvz.get():
>         print "{0}. {1} => {2}" .format(vm['vmid'], vm['name'], vm['status'])

Traceback (most recent call last):

File "create.py", line 2, in
proxmox = ProxmoxAPI('https:///', user='',password='***', verify_ssl=False)
File "C:\Users\power\Desktop\PY\proxmoxer\proxmoxer\core.py", line 106, in init
self._backend = importlib.import_module('.backends.%s' % backend, 'proxmoxer').Backend(host, **kwargs)
File "C:\Users\power\Desktop\PY\proxmoxer\proxmoxer\backends\https.py", line 117, in init
host, host_port = host.split(':')
ValueError: too many values to unpack

@hocineKHE
Copy link
Author

hocineKHE commented Apr 17, 2019 via email

@elschman
Copy link

elschman commented Apr 17, 2019

proxmox = ProxmoxAPI('https:///', user='',password='***', verify_ssl=False)

It looks like you forgot to mention the node you want to use to manage the proxmox.

proxmox = ProxmoxAPI('https://[PROXMOXNODE]/', user='',password='***', verify_ssl=False)

@hocineKHE
Copy link
Author

ip addresse ?

https://@:port/
that's all ??

@elschman
Copy link

See the main page at

Short usage information

@hocineKHE
Copy link
Author

hocineKHE commented Apr 21, 2019 via email

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

No branches or pull requests

2 participants