Re: [pve-devel] Fwd: qm changes

2018-02-28 Thread Nicholas Schembri
All of the command line tools are using the api; we can us pvesh to talk
about the issue.

I'm thinking that we should not search all nodes looking for the vm.  I'm
not sure how the gui build the virtual machine list but I'm thinking it
might be nice to have the same thing at the nodes level in the api.

in this example I need to know  the source node:
pvesh create nodes//qemu//migrate --target 

How about :
pvesh ls nodes/qemu # list all vmid in the cluster
pvesh create nodes/qemu/1000/status/start
pvesh create nodes/qemu/1000/status/stop

pvesh get nodes/qemu/1000/status/current  # this is missing the node, but
in the current api it's part of the path

pvesh get nodes/qemu/1000/status/node # add  get node
or
# long listing
pvesh ls -l nodes/qemu/
Dr--d 10  red
Dr--d 1000  blue
Dr--d 110  green
Dr--d 111  red
Dr--d 112  red
Dr--d 113  red
Dr--d 120  blue
Dr--d 121  blue
Dr--d 122  green
Dr--d 123  red
Dr--d 200  blue


so from the little looking i've done,  I should be looking in Nodes.pm,
/usr/share/perl5/PVE/API2/usr/share/perl5/PVE/API2
to add a list of all vm's to the nodes dir?
or is this something that found in the base /usr/share/perl5/PVE/Cluster.pm,
Qemu.pm, LXC.pm,  QemuServer.pm

can you just point me to a good starting place?

On Mon, Feb 26, 2018 at 1:42 AM, Wolfgang Link  wrote:

> Hi Nicholas,
>
> you can do this over the API.
> If you like to do this in a bash script you can use "pvesh" [1].
>
> pvesh create nodes//qemu//migrate --target 
>
> Here [2] can you see the full API tree.
>
> [1]: https://pve.proxmox.com/wiki/Proxmox_VE_API#Using_.27pvesh.
> 27_to_access_the_API
> [2]: https://pve.proxmox.com/pve-docs/api-viewer/index.html
>
> Best Regards,
>
> Wolfgang Link
>
> w.l...@proxmox.com
> http://www.proxmox.com
>
> 
> Proxmox Server Solutions GmbH
> Bräuhausgasse 37, 1050 Vienna, Austria
> Commercial register no.: FN 258879 f
> Registration office: Handelsgericht Wien
>
>


-- 
Thank you for your time,


Nicholas A. Schembri
337 Brookside blvd.
Pittsburgh pa 15241
734-678-6435
___
pve-devel mailing list
pve-devel@pve.proxmox.com
https://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


Re: [pve-devel] Fwd: qm changes

2018-02-25 Thread Wolfgang Link
Hi Nicholas,

you can do this over the API.
If you like to do this in a bash script you can use "pvesh" [1].

pvesh create nodes//qemu//migrate --target  

Here [2] can you see the full API tree.

[1]: 
https://pve.proxmox.com/wiki/Proxmox_VE_API#Using_.27pvesh.27_to_access_the_API
[2]: https://pve.proxmox.com/pve-docs/api-viewer/index.html

Best Regards,

Wolfgang Link

w.l...@proxmox.com
http://www.proxmox.com


Proxmox Server Solutions GmbH
Bräuhausgasse 37, 1050 Vienna, Austria
Commercial register no.: FN 258879 f
Registration office: Handelsgericht Wien

___
pve-devel mailing list
pve-devel@pve.proxmox.com
https://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


[pve-devel] Fwd: qm changes

2018-02-22 Thread Nicholas Schembri
Before I start, I love proxmox.  This is a great product, and I use it
everyday.


I have some bash scripts that need to be converted into api calls. I'm
hoping that someone would help me get started.  I'm happy to do the work.

qm is missing some features:
qm migrate   --online # this should pull the vm
to the current host
qm migrate  $(hostname) --online


qm list --all  # this
should show all vm's and node names.

qm stop  # this should stop
the vm on the remote node
qm start  # this should start
the vm on the remote node


The how and why:
I use vm's for regression testing.  I rebuild the vm's from image before
each test.  I need to stop the vm before I reimage. When they start, they
put a load on the network and the host.  It helps to keep the vm's balanced
across the cluster.
I used shell scripts to walk the /etc/pve/nodes tree and find of move the
vm.  Stopping the vm and moving the vm to the correct node feels like a
task for qm



-- 
Thank you for your time,


Nicholas A. Schembri
Pittsburgh pa




-- 
Thank you for your time,


Nicholas A. Schembri
337 Brookside blvd.
Pittsburgh pa 15241
734-678-6435
___
pve-devel mailing list
pve-devel@pve.proxmox.com
https://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel