VMware Cloud Community
RanjnaAggarwal
VMware Employee
VMware Employee

How to Stop the Machine Deletion after lease expiry in vRA

As i can see archive period is mandatory so how we can keep the expired vm for unlimited number of days without deleting it.

Regards, Ranjna Aggarwal
0 Kudos
9 Replies
jhague
VMware Employee
VMware Employee

‌If you're entitled to extend the lease duration you should be able to configure a new lease and power the VM back on. As for it being unlimited it depends what has been defined in the blueprint? When a machine lease is extended, the user can extend the lease beyond the normal restrictions of th...

John Hague http://linkedin.com/in/john-hague | twitter @jhague10 VCIX-DCV | VCP-DCV 3/4/5/6 | VCP6-NV | VCP7-CMA | VCAP7-CMA Design
0 Kudos
RanjnaAggarwal
VMware Employee
VMware Employee

But what about keeping archival days unlimited?

Regards, Ranjna Aggarwal
0 Kudos
jhague
VMware Employee
VMware Employee

‌The archive period is defined in the blueprint and is not something that can be modified other than in the blueprint. You can potentially extend the lease while the VM is in its archive period but once the archive period expires it will be destroyed - what are you trying to achieve? Can you not just set an unlimited lease?

John Hague http://linkedin.com/in/john-hague | twitter @jhague10 VCIX-DCV | VCP-DCV 3/4/5/6 | VCP6-NV | VCP7-CMA | VCAP7-CMA Design
0 Kudos
RanjnaAggarwal
VMware Employee
VMware Employee

If I will keep lease to unlimited = VM's will be in Powered on State as this won't power off automatically, due to this unlimited option is not right choice. Keeping lease to limited value means power off them automatically with keeping unlimited archival period don't delete them automatically

Regards, Ranjna Aggarwal
0 Kudos
jhague
VMware Employee
VMware Employee

I'm not aware of a way to do that natively but I guess there are a couple of options...

1) Set the archive period to something waaaay in the future that won't realistically get triggered (e.g. 999999).

2) Use a PowerCLI script at the vCenter level to power off the VM if it is x days past it's creation date. There are a number of examples of how to get the creation date out there.

After the VMs are powered off what do you want to do with them? Presumably you don't want to leave them that way consuming storage indefinately if they are not in fact used?

John Hague http://linkedin.com/in/john-hague | twitter @jhague10 VCIX-DCV | VCP-DCV 3/4/5/6 | VCP6-NV | VCP7-CMA | VCAP7-CMA Design
0 Kudos
SeanKohler
Expert
Expert

As you know, 0 deletes it immediately. As John already mentioned.... Can't you use 9 million days?  Isn't that unlimited for our technological purposes?  How about 900 million days?

As a side note, this value is maintained in the IaaS DB.

Table: dbo.virtualMachine.

Column: ExpireDays

Type: Integer

Max Value: 2,147,483,647


We have needed to update this archive days for existing machines, and we worked with support to try to change the value here.  We are waiting 6 more days to see if our archive extension worked, but it looks like it will.

0 Kudos
RanjnaAggarwal
VMware Employee
VMware Employee

I can go with 9 Million but customer query was if we have to type 9 million, why can't VMware offer unlimited option here

Regards, Ranjna Aggarwal
0 Kudos
RanjnaAggarwal
VMware Employee
VMware Employee

Can you please redirect me to any document link that describes what are tables available in database and that are types of entries available in them?

Regards, Ranjna Aggarwal
0 Kudos
SeanKohler
Expert
Expert

>>I can go with 9 Million but customer query was if we have to type 9 million, why can't VMware offer unlimited option here


Without them rewriting the portion of the DynamicOps product which determines how archive days are handled (to include the code for execution of the machine deletion  AND the presentation of the information in the UI), I expect the only thing they could do would be to have a UI checkbox that effectively sets the existing field that exists in the database to the MAX possible value.  It wouldn't be unlimited, but your customers wouldn't be around anymore to know it.  (sorry for the morbidity)


That one value has some significance in the product and a rewrite to support this ask wouldn't be available to your customer today: in the product version you are currently running. I would suggest asking for a MAX VALUE checkbox. You would have to submit it as a feature request and accept whatever priority Engineering could put on it.



Regarding your other question...

I do not have a database table reference: and of course, we like to use the API, CloudClient, and builtin capabilities for anything possible.  Writing change into the back-end DB isn't supportable or recommended, but sometimes we customers have no choice.

0 Kudos