Can someone confirm that Packer -force does not delete existing template in Proxmox ?

koval

Well-Known Member
Dec 19, 2017
31
0
46
34
Can someone confirm that Packer with -force option does not delete existing template in Proxmox ?

When I running packer build -force, the build consistently fails with
Error creating VM: error creating VM: 500 unable to create VM 8001 - VM 8001 already exists on node 'pve', error status:

From the Packer documentation, I would expect -force to clean up an existing template with the same name, as the template is neither a vm nor is it turned on.

Proxmox 7.2-11 Packer 1.8.3

Just want to be sure that this is not only problem in my env.
 
Are you asking about this :
Code:
-force - Forces a builder to run when artifacts from a previous build prevent a build from running. 
The exact behavior of a forced build is left to the builder. 
In general, a builder supporting the forced build will remove the artifacts from the previous build. 
This will allow the user to repeat a build without having to manually clean these artifacts beforehand.

If you are, then its a question that should be directed at the "builder", ie Packer community.


Blockbridge : Ultra low latency all-NVME shared storage for Proxmox - https://www.blockbridge.com/proxmox
 
Are you asking about this :
Code:
-force - Forces a builder to run when artifacts from a previous build prevent a build from running.
The exact behavior of a forced build is left to the builder.
In general, a builder supporting the forced build will remove the artifacts from the previous build.
This will allow the user to repeat a build without having to manually clean these artifacts beforehand.

If you are, then its a question that should be directed at the "builder", ie Packer community.


Blockbridge : Ultra low latency all-NVME shared storage for Proxmox - https://www.blockbridge.com/proxmox
Yes, I am asking about this option. I have already asked at Packer community. But I also thought that maybe someone from Proxmox community is using Packer with this option and can share the information.
 
Hello, the `-force` option is not meant to remove the template from the proxmox cluster. It has nothing to do with the proxmox provider, and will only delete packer artifacts (local to your packer env).

in order to remove the template, you'd need some kind of wrapper (?bash script?) that would make the check beforehand, to ensure that either: VMID required isn't already taken, or remove the template that has this VMID if it exists. I am currently working on exactly that to make sure packer builds can be done in a gitlab-ci pipeline.

Best,
 
  • Like
Reactions: koval

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!