Linked Clones w/ gui

philk1989

New Member
Oct 9, 2011
11
0
1
I was wondering if anyone could help me add a function to the GUI.

Right now I create linked clones by doing this: # qemu-img create -b /storage/vms/images/base_images/baseimg.qcow2 -f qcow2 /storage/vms/images/VMID/vm-VMID-disk-1.qcow2

I wanted to automate this process so that the linked clone would automatically get all the specified configuration options but be a linked clone of a specified base image.

I looked through the proxmox web code in /usr/share/pve-manager/root/ and found create.htm in /usr/share/pve-manager/root/vmlist/. It looks like I should be able to add something like this...
##
# custom code to enable the creatition of a linked clone
$grid->add_row (__("Linked Clone") . ':',
$form->create_element ('','bool',
defined ($fdat{}) ? fdat{} : 0));
$grid->add_row (__("Base Images") . ':',
$form-create_element ('','dropdown',
$fdat{}, $vartmp));
$out .= PVE::HTMLUtils::create_statusframe (undef, __("Linked Clones"), undef, $html);
$out .= "<br>";

##

...to the end of the file, just before the create button. However, I have no idea what $fdat does. Is it a function? All I really need to accomplish is to see if the checkbox is checked and run the qemu command listed above after the initial image is created. The linked clone would then override the virtual disk that was initially created.

Any help would be very much appreciated.

To the proxmox team: please add this in 2.0!! ;)

Thank you in advance,

Phil


sq49ys.jpg
 

Attachments

  • proxmox_linked_clone.jpg
    proxmox_linked_clone.jpg
    117.6 KB · Views: 7

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 yours easily in our online shop.

Buy now!