Help with API - disk creation and assignment

Virtus

New Member
Dec 24, 2018
4
0
1
32
Hello!

I'm making a tool to migrate from vmware to proxmox. I've got everything done except for handling the disks.

I can't quite get the syntax right for creating LVM disks.

Ideally I want to create a bunch of 1gb LVMs when I import the configs, then resize them to the correct size later as I import the vmdk data into the LVMs.
If that's not something I can do through the API, I'll just create them to the full size initially.

I have qcow2 working, but not LVM. Syntax I am playing with is:
media=local-lvm:vm-1337-disk-1,size=250G

I am using proxmoxer/python for the tool, once i get approve from mgmt, I'll post a link to my repo
 

Virtus

New Member
Dec 24, 2018
4
0
1
32
Also,

Doing this I've learned a ton about the API and proxmox. I would love to contribute to the documentation, especially the API documentation but it's a little unclear to me how I can do so. I can't even register on the wiki
 

Virtus

New Member
Dec 24, 2018
4
0
1
32
so I figured it out, but it doesn't actually create the LVM, is there a way to do that through the API? Its done in the UI so I don't see the difference
 

tim

Proxmox Retired Staff
Retired Staff
Oct 1, 2018
330
47
33
If the behavior you are looking for is already implemented in our web interface you could check your browsers developer tools. There you can take a look at each request which is performed, that's probably the easiest way to see which endpoint to use for a particular action.

Actually there is already a CLI tool to import disk images:
https://pve.proxmox.com/pve-docs/pve-admin-guide.html#_importing_virtual_machines_and_disk_images

What do you mean by "but it doesn't actually create the LVM"?
Do you mean there is no LV created for that particular disk or are you talking about the whole VG?
 

oguz

Proxmox Retired Staff
Retired Staff
Nov 19, 2018
5,207
704
118
I would love to contribute to the documentation, especially the API documentation but it's a little unclear to me how I can do so. I can't even register on the wiki

The wiki registrations have been unfortunately disabled because of spam. If you would like to contribute, I suggest you to read the following:
https://pve.proxmox.com/wiki/Developer_Documentation

The documentation can be found in repository pve-docs
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get your own in 60 seconds.

Buy now!