If you are a VMware administrator you know what a pain it is to manage snapshots. Virtualization makes it easy to snapshot a VM before a patch or an upgrade is applied to an application or OS and gives you that peace of mind that you can revert back if it fails. The reality is that users never clean up there snapshots and it starts getting used as a backup method in environments which places the burden on VMware admins to manage the clean up efforts. VMware recommends not using snapshots for more than 3 days since it can cause serious performance, storage and corruption problems in your environment.
So how you do you handle snapshots? A lot of customers just give up and take the chance of nothing going wrong, or they end up disabling this very valuable feature so users cannot use it all. None of these methods are good.
SovLabs modules provides policies that control the expiration and deletion of VM snapshots as well as the ability to provide notifications to the VM owner. The VM owner is not given the option to extend the time of how long the snapshot lives and it will be automatically removed based on the lifespan in days set by the vRA administrator.
Configuration:
- Add SovLabs vCenter Endpoint
- This configuration was covered in my previous post which can be viewed here.
- Add SovLabs vRA CAFE Endpoint
- Select Catalog -> SovLabs vRA Extensibility
- Click Request on “Add SovLabs vRA CAFE Endpoint”
- Enter Configuration label
- Only AlphaNumeric characters, no spaces or special characters except:
-
and_
- Only AlphaNumeric characters, no spaces or special characters except:
- Version and Hostname are auto-generated and based on querying vRA CAFE, verify that the information is correct
- If you have not configure this endpoint module then you need to create credentials.
- Click Submit
- Add SovLabs vRA IaaS Endpoint
- Select Catalog -> SovLabs vRA Extensibility
- Click Request on “Add SovLabs IaaS CAFE Endpoint”
- Enter Configuration label
- Only AlphaNumeric characters, no spaces or special characters except:
-
and_
- Only AlphaNumeric characters, no spaces or special characters except:
- Version, Hostname and Domain are auto-generated and based on querying vRA CAFE, verify that the information is correct
- If you have not configure this endpoint module then you need to create credentials.
- Click Submit
- Add Notification Configuration
- Select Catalog -> SovLabs vRA Extensibility
- Click Request on “Add Notification Configuration”
- New message server = yes
- new fields will appear
- Enter Configuration label
- Only AlphaNumeric characters, no spaces or special characters except:
-
and_
- Only AlphaNumeric characters, no spaces or special characters except:
- Enter message server address
- Enable SSL if required
- Enter message port
- Select message type
- Select message server protocol
- Select yes from drop down box if your SMTP requires authentication.
- Select yes from new credentials
- Enter configuration label
- Enter username and password
- Enable STARTTLS if required
- Set network timeout
- Since I selected message type as email, you need to setup your email groups.
- Select yes to create new group
- Enter email group configuration label
- Enter To and/or CC and BCC addresses
- Click Next
- Enter notification configuration label
- Only AlphaNumeric characters, no spaces or special characters except:
-
and_
- Only AlphaNumeric characters, no spaces or special characters except:
- Select type = SNAPSHOT
- Select state = Whether or not to send notifications when a new snapshot is found (NEW), when a snapshot is about to be deleted (WARNING), and/or when a snapshot has been deleted (DELETE)
- Select format
- Enter From address
- Enter Title
- Enter Body
- In the documentation they have some notification examples which you can just copy/paste and customize, which is very helpful.
- Click Submit
- Add Notification Group Configuration
- Select Catalog -> SovLabs vRA Extensibility
- Click Request on “Add Notification Group Configuration”
- Enter Configuration label
- Only AlphaNumeric characters, no spaces or special characters except:
-
and_
- Only AlphaNumeric characters, no spaces or special characters except:
- Select Type = snapshot
- Select Notification = previously create notification configuration.
- Add Snapshot Configuration
- Select Catalog -> SovLabs vRA Extensibility
- Click Request on “Add Snapshot Configuration”
- Enter Configuration label
- Only AlphaNumeric characters, no spaces or special characters except:
-
and_
- sovlabs_snapshot_config_BG_all_2days
- Only AlphaNumeric characters, no spaces or special characters except:
- Select SovLabs vRA CAFE Endpoint from dropdown. This was configured earlier.
- Select SovLabs vRA IaaS Endpoint from dropdown. This was also configured earlier.
- Select Notification Group. Make sure you have a notification group of type snapshot define. This was also configured earlier.
- Select if you want to manage snapshots for all business groups = yes
- Enter snapshot lifespan in days
- Per VMware’ recommendation try to stay within less than 3 days
- Enter the days before expiration a warning notification should be send out.
- Click Next
- Set the snapshot scheduler. So the scheduler you set here goes out and checks each VM if they have a snapshot that might be expiring or is expired and needs to be deleted. Once create, a vRO schedule task is created which runs every 15min to make sure that the snapshot scheduler sends out the notification at the specified time.
- Leave schedule as active
- Set schedule type = daily
- most customers would pick daily
- Set the time to run in military format
- Can leave schedule end date blank to run forever.
- Click Submit
Enable the module:
- Based on the set scheduler, an inventory update will automatically run and send notifications.
- If a snapshot’s age has met the expiration day, it will automatically get deleted.
- The last SovLabs Snapshot Configuration deleted, deletes the vRealize Orchestrator scheduled task for Snapshot Management. It automatically creates it again if a snapshot configuration is created and scheduled task is not found.
Disable the module:
- Login to the vRA tenant
- Select Catalog -> SovLabs vRA Extensibility
- Click Request on “Manage Snapshot Scheduler”
- Select Suspend from the Action dropdown list.
- Click Submit
- (if you want to resume this module again you can perform the same actions as above but select Action “resume” from dropdown list.