Virtual Machine expiration date?

ElDark258

Member
Apr 5, 2022
6
2
8
So here's the thing, at the office, branches may contract multiple people for a fixed period of time, the point is, whenever their contract expires not all branches tell us about it, and we have to be searching documentation in HR to make sure the person is not working with us anymore so that we know their assigned virtual machine will not be used anymore, therefore we need to delete such VM after their contract time has expired.

Question is: Is there a way to have Proxmox know that the virtual machine has an expiration date and be able to delete such machine after that time?
 
So here's the thing, at the office, branches may contract multiple people for a fixed period of time, the point is, whenever their contract expires not all branches tell us about it, and we have to be searching documentation in HR to make sure the person is not working with us anymore so that we know their assigned virtual machine will not be used anymore, therefore we need to delete such VM after their contract time has expired.

Question is: Is there a way to have Proxmox know that the virtual machine has an expiration date and be able to delete such machine after that time?

Maybe you can make cronjobs with exact date and delete command in it?
Or you can use the tag/label option for every vm where you put the date of expiration in.
 
Maybe you can make cronjobs with exact date and delete command in it?
Thats what on-boarding and off-boarding processes are for, developed between HR and IT. What if the contract is extended? What if data is needed for legal discovery.
There should be one source for such information, normally AD or LDAP. Cleanup of the VMs should be tied in with email/vpn/etc access being disabled.
But its @ElDark258 's business - if cron is whats making you happy, sure, why not.


Blockbridge : Ultra low latency all-NVME shared storage for Proxmox - https://www.blockbridge.com/proxmox
 
  • Like
Reactions: ElDark258
Thats what on-boarding and off-boarding processes are for, developed between HR and IT. What if the contract is extended? What if data is needed for legal discovery.
There should be one source for such information, normally AD or LDAP. Cleanup of the VMs should be tied in with email/vpn/etc access being disabled.
But its @ElDark258 's business - if cron is whats making you happy, sure, why not.


Blockbridge : Ultra low latency all-NVME shared storage for Proxmox - https://www.blockbridge.com/proxmox
In case of a contract extention he can restore a backup (PBS) ?
 
In case of a contract extention he can restore a backup (PBS) ?
;-) The point is that there are many "ifs". Adding something in crontab by IT team that doesn't have a good communication with HR, as indicated by initial post, is a receipt for disaster.


Blockbridge : Ultra low latency all-NVME shared storage for Proxmox - https://www.blockbridge.com/proxmox
 
Actually @bbgeek17 is right, there are many a few times when HR decides to extend person A's or person B's contract, in which case deleting their VM's is a no go, it's the reason why we put the effective expiry date for a day later generally speaking, since the files should be taken care of anyways before effectively deleting the VM.

The idea of cron is not bad at all, but considering the aforementioned it makes sense not to be so strict with that.

Now, I didn't consider using the command line for managing VM's, I'd usually do it from the web interface, but thinking that qm config <vmid> will also return the tags info, I could parse the date from there, I guess I could just run a for cycle and execute qm config for every VM in each server (yeah, we got about 14 proxmox servers lol) to get each machine's expiry date, so that should make for an easier checking.

Thanks a lot for your feedback guys, now I got my brains gathering ideas regarding this :D
 
Thanks a lot for your feedback guys, now I got my brains gathering ideas regarding this
I'd say definitely dont delete anything automatically :-)
Run a cron job every day at 9am to query VM tags and if the date is overdue - blast HR/IT/CEO with a full list asking someone to either confirm departure or extend the lifetime.


Blockbridge : Ultra low latency all-NVME shared storage for Proxmox - https://www.blockbridge.com/proxmox
 
I'd say definitely dont delete anything automatically :)
Run a cron job every day at 9am to query VM tags and if the date is overdue - blast HR/IT/CEO with a full list asking someone to either confirm departure or extend the lifetime.


Blockbridge : Ultra low latency all-NVME shared storage for Proxmox - https://www.blockbridge.com/proxmox
My thoughts exactly! I did implement it actually, since the servers are set to mail me in case of any issues, i took the same approach for the expiration date, hope this helps someone else in the future