VMware Cloud Community
scottont
Contributor
Contributor

Snapshots via a Custom Web Page using PowerCLI

Aftn all,

I've looked around and can see the associated code for taking a snapshot, reverting back a snapshot, checking the age of a snapshot etc which I can get my head around, however I have a slightly bigger requirement.

Complete newbie when it comes to this so apologises with this seems noddy

Background,

We would like to offer Application testers the ability to self administer VM's - We have a few virtual desktops set to one side, (Citrix XenDesktop v5.5 running on top of ESXi v4.1 - Moving to v5 in the coming months) and what we would like to offer them is the ability to pick their assigned VM (ie select from a list\drop down etc) and take \ revert snapshots of that VM all from a purpose built web page.

On top of this I would like to add in the date the snapshot was taken , so they can keep an eye on how old the snapshot is.

Also we will be looking to limit the snapshots per VM to 1 (otherwise it will be a housekeeping nightmare)

So I thought we could have a box where they select their VM from and then another box where it displays their Snapshot and date (or age) and then have a couple of buttons each running PowerCLI commands under them to either take a snapshot and directly overwite the image there or revert a snapshot.

There by offering the ability to have a VM, take a snapshot, then install an app, test it and revert back to the vanilla machine snapshot before installing another app etc etc

Any help and assistance would be greatly apprecitaed as I do not seem to be getting very far with Google ...

Thanx

Tony

0 Kudos
3 Replies
MartinAmaro
Expert
Expert

In my opinion you will have better control and management if you use the Citrix provisioning services. Starting with PVS 6.0 you get versioning and a snapshot for a vDisk. Now you can create a new version of the vDisk and a svhd file is created contiaing the changes. See URL for detials http://blogs.citrix.com/2011/09/28/provisioning-services-6-0-from-single-image-delivery-to-single-im...

At the PVS environment you will create a Test device collection that they will have access to and vdisk pool etc ..

If you want to pursue the VMware\snapshot way of doing it then you can create a Role for the application testers and give them rights to manage VMs, create snapshots etc etc, then apply the role to the necessary ESX host, VMs, Luns etc depending on your needs (similiar to the role you created for Xendesktop). Just have them install the vcenter client or they can use the web client.

I hope this helps

If you find this or any other answer useful please consider awarding points by marking the answer correct or helpful.
0 Kudos
LucD
Leadership
Leadership

Could any of the solutions suggested in Establishing a PowerCLI execution web/email server help you ?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
scottont
Contributor
Contributor

Thank you for the responses, But PVS isnt an option at this time, and I would prefer to try and deliver an easier to use Web page rather than the Web version of vcentre, as the only thing they need to do is take\revert snapshots.

I have an idea, on what to produce and will give it a stab, I just thought other people must have done something similar in the past and I could check out their work.

If anyone is interested I'll post the code when complete.

0 Kudos