create a new vm using a iso setting cpu ram network via api
-
hi
i am struggling with the api.can i do the following using api?:
- Create a VM using ubuntu 22X. template
- define the following:
-) CPU, Ram, bios, network interface and iso i want to use for install
then it should start vm creation and run my iso (its a autoinstall iso)
i was able to make it work using packer but packer plugin is quit old and not really mantained...
br
mark
-
Hi,
Packer plugin is maintained. Which one you used?
-
Hi Oliver,
I’ve been experimenting with Terraform — I can create a VM and boot it using my autoinstall ISO, but unfortunately, most other things aren’t working as expected.
So I gave Packer a try instead.
With Packer, I can successfully create a VM, mount the ISO, and perform the installation.
At the moment, I’m stuck trying to reliably detect when the VM installation is actually finished — I’m currently working on a script to solve that.
Out of curiosity: how do you handle the Xen Orchestra appliance installation?
Here’s what I’m aiming for:
We want to generate a custom VM image for our clients to import into different hypervisors (VMware, Xen, XCP-ng, Hyper-V, VirtualBox).
My current workflow and progress:
Generate autoinstall ISO with custom config — DONE
Create VM, mount ISO, perform install, and detect when installation is complete — NOT WORKING YET
Shut down the VM — DONE
Export VM as an OVA template — DONE
Convert that export to other formats for common hypervisors — DONE
Upload final images to our storage for delivery to clients — DONE
The goal is to fully automate the process — like a CI/CD pipeline for VM images.
Right now, I’m able to do nearly everything except reliably detecting when the VM installation is finished.
br
mark
-
That's a question for the DevOps Tools team
Ping @devops-team
-
@markxc said in create a new vm using a iso setting cpu ram network via api:
Out of curiosity: how do you handle the Xen Orchestra appliance installation?
We use Packer, a Debian iso and an Ansible playbook in the ansible provisioner. See https://developer.hashicorp.com/packer/integrations/hashicorp/ansible/latest/components/provisioner/ansible
With this setup, we achieve these tasks:
- Create VM, mount ISO, perform install, and detect when installation is complete
- Shut down the VM
- Export VM as an OVA template
We also have a CI/CD pipeline doing this automatically.
-
thanks for info
i used https://github.com/ddelnano/packer-plugin-xenserver
but because of lack of ssh key support i changed the code a bit.
now i can use ssh keys. (not ready for a PR)my problem is that inside the auto iso i use a shell script doing a reboot within the install.
the reason is that i use this iso also on bare metal installations, some software i cant install without doing a reboot.i will now focus on the ansible integratian an fire the commands after the reboot using ansible.
this might work.br
Mark