Solved

Restore snapshots on VM servers weekly

Posted on 2012-03-26
4
409 Views
Last Modified: 2012-06-27
So far after looking around for a while I cannot seem to find what I'm looking for.

We have some testing environments that we rebuild every Sunday.  Right now these are scattered across different machines and that have some issues.  What want to do is every Sunday evening reapply a snapshot of the server to return it to a baseline.  

We will build the VM to our gold standard then take a snapshot.  Once that is done we will release the environment to the users and they do what they do best.  Then Sunday evening I want to apply the snapshot we created after creating the gold standard, thus returning the environment to it's clean state.  Anyone have any suggestions?  Did I miss something in the VMCenter?

Thanks.
0
Comment
Question by:mcioffi209
  • 3
4 Comments
 
LVL 119
ID: 37768465
Revert to Snapshot every Sunday evening using a PowerCLI script.

vCenter can schedule some tasks for automation

e.g. Deploy, Migrate, Create, Create a snapshot but not Revert.

See this Link

http://ict.myjewe.nl/ict/?p=192
0
 
LVL 119
ID: 37768504
Basic Revert to Snapshot for Snapshot called Baseline

Get-VM | `
ForEach-Object {
  Set-VM -VM $_ -Snapshot  (Get-Snapshot -VM $_ -Name Baseline) -Confirm:$false
}

Open in new window

0
 
LVL 119

Accepted Solution

by:
Andrew Hancock (VMware vExpert / EE MVE^2) earned 500 total points
ID: 37768733
So install the following:-

PowerCLI and PowerGUI on a Workstation

I would recommend using the following, also VMware recommends the use of PowerCLI, which is PowerShell interface with vSphere-specific additions.

http://communities.vmware.com/community/vmtn/server/vsphere/automationtools/powercli

One of the simplest PowerCLI examples, and something which is actually extremely useful on its own, is the Get-VM cmdlet. Which lists VMs.

PowerCLI can be a bit overwhelming to use,  But it can be enhanced with a nice toolset and a library of preconfigured scripts to jump-start your mass changes, which is possible with PowerGUI

http://powergui.org/index.jspa

and run this script when you need to using Task Scheduler
$snapshot = Get-Snapshot –VM myVM –Name ”Target-Snapshot”
Set-VM –VM myVM –Snapshot $snapshot

Open in new window

0
 

Author Closing Comment

by:mcioffi209
ID: 37771636
Thanks, we will be digging into this over the next 5 days or so.  But that looks pretty much like what I need.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When rebooting a vCenters 6.0 and try to connect using vSphere Client we get this issue "Invalid URL: The hostname could not parsed." When we get this error we need to do some changes in the vCenter advanced settings to fix the issue.
Giving access to ESXi shell console is always an issue for IT departments to other Teams, or Projects. We need to find a way so that teams can use ESXTOP for their POCs, or tests without giving them the access to ESXi host shell console with a root …
Teach the user how to install log collectors and how to configure ESXi 5.5 for remote logging Open console session and mount vCenter Server installer: Install vSphere Core Dump Collector: Install vSphere Syslog Collector: Open vSphere Client: Config…
This video shows you how to use a vSphere client to connect to your ESX host as the root user. Demonstrates the basic connection of bypassing certification set up. Demonstrates how to access the traditional view to begin managing your virtual mac…

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question