theforeman / foreman_fog_proxmox

Foreman plugin to add Proxmox compute resource based on fog-proxmox gem
GNU General Public License v3.0
106 stars 31 forks source link

Use provided compute settings from Foreman using image-based deployment #130

Closed jtruestedt closed 3 years ago

jtruestedt commented 4 years ago

If I use Proxmox in Foreman to deploy a new machine using image-based deployment, I can select the image I imported from my Proxmox-Cluster. However, all settings provided by the "Virtual Machine"-tab and the compute attributes for the network interfaces are completly ignored. Everything gets configured like in the provided image. This would mean I need to have diffrent images for each CPU, memory, disk, vlan combination.

I wish to select an image, where my new vm is cloned from, that uses cpu, memory, disk & network interface configuration like I provide in Foreman and after I click "Submit" the machine gets cloned, the compute attributes are configured like in Foreman, then the machine gets started and the finish-script is started.

After a deployment I can already modify these settings and they are "fixed" in Proxmox and may need a reboot. However, due to the network settings I cannot use the finish-template without working network-configuration.

I assume in the image-based deployment just the step to use the provided settings to overwrite the CPU and memory of the template is missing. For the disks I cannot just overwrite the settings, since I want the disk of my template but maybe I want to increase the disksize or provide an additional disk (which is then not partitioned).

Probably the disk part is similar as already suggested in https://github.com/theforeman/foreman_fog_proxmox/issues/80

tristanrobert commented 4 years ago

I don't know what is your issue. You have many features in Foreman and Foreman with Proxmox to use a vm as a template:

jtruestedt commented 4 years ago

I know these features but if I now have a setup with more than one vlan and a policy, which does not allow me to use TFTP, i cannot use a network based installation using preseed or kickstart. However with Foreman and other compute resources I can create an image/template in my compute resource and use this as image in Foreman. So far this works as well for Proxmox.

But other providers like VMware allow me to use this image and change the vm-hardware-settings like cpu, memory, network and disks during the creation. If I submit the new host the template is used to create the host, then the hardware like cpu, memory, network and disk settings are adjusted automatically before the new host is started and provisioned with a finish template.

Currently with Proxmox this way is only possible if I create the host from the image/template without starting it, then I can edit the settings in a new step and then poweron the machine. After this I have to run the finish-scripts manually since they cannot be used during creation because the host isn't powered on. However if I power it on and cannot adjust the settings before start, the host might end up in the wrong vlan and cannot be reached via network anyway.

jacac commented 4 years ago

Just ran into the same issue using a container as an image. Network configuration are not updated after the clone process finishes, which leads to Proxmox having the cloned configuration and Foreman showing the one configured through Create host process.

It would be nice if the process would be clone -> configure -> start.