To create a vm, foreman uses vm_exists? from app/models/concerns/orchestration/compute.rb which uses persisted? from app/models/concerns/fog_extensions/model.rb which uses !!identity from fog.
The issue is that proxmox requires vmid to be submitted by the client in order to create a new vm.
vmid is the identity attribute. So it is always persisted to foreman.
To resolve it, it is necessary to overwrite persisted? method.
To create a vm, foreman uses vm_exists? from app/models/concerns/orchestration/compute.rb which uses persisted? from app/models/concerns/fog_extensions/model.rb which uses !!identity from fog. The issue is that proxmox requires vmid to be submitted by the client in order to create a new vm. vmid is the identity attribute. So it is always persisted to foreman. To resolve it, it is necessary to overwrite persisted? method.