Solved

reverting to a clean VM from ESX console

Posted on 2012-03-14
7
422 Views
Last Modified: 2012-03-14
Is there a way to remote into the esx console via ssh and revert/start a VM. trying to do this via a script.

Thanks
0
Comment
Question by:progjm
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
7 Comments
 
LVL 9

Expert Comment

by:bharrington83
ID: 37720566
Do you have vcenter?  If you have vcenter you can do it through the powershell kit.
0
 
LVL 1

Author Comment

by:progjm
ID: 37720576
One of the servers yes, but not the other
0
 
LVL 9

Expert Comment

by:bharrington83
ID: 37720588
what do you mean, on one but not the other, are we talking about two different locations, or are you using the free version?
0
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 
LVL 121

Accepted Solution

by:
Andrew Hancock (VMware vExpert / EE MVE^2) earned 350 total points
ID: 37720596
There are PowerCLI commandlets for starting, stopping, restarting and suspending virtual machines – Start-VM, Stop-VM, Suspend-VM, Stop-VM. The follow examples show how to use some of them:

# filtering machines by name and start those that are not started
Get-VM <name-filter> | where { $_.PowerState –eq "PoweredOff" } | Start-VM

# stopping virtual machine, defining that we do not want to confirm
# each stop operation
Get-VM <name-filter> | Stop-VM –confirm:$false

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

VMware Community Pack

http://www.virtu-al.net/featured-scripts/vmware-powerpack/

It's also worth looking at The free VMware Guest Console

http://labs.vmware.com/flings/vgc

The free VMware Guest Console, an experimental application created by VMware Labs, is a great tool for managing vSphere VM processes and files. You can view, sort and kill processes across all VMs, and you can also run a script on all Windows or Linux VMs.

If you do want a script, LucD (1 of *the* premier PowerCLI gurus; literally co-wrote the book on PowerCLI :) ) provides a script in the following link:

http://communities.vmware.com/thread/271097?tstart=780
0
 
LVL 1

Author Comment

by:progjm
ID: 37720675
@bharrington83 yes they are two seperate boxes (one connected to VCenter and one not), located on different networks. Neither are free versions

thanks hanccocka, let me check if these will work
0
 
LVL 9

Assisted Solution

by:bharrington83
bharrington83 earned 150 total points
ID: 37720778
You can use the PowerCLI direct to an esxi server, it's just advantageous to use vcenter. As far as reverting goes, you'll need to have a snapshot running all the time,  then to revert, just revert the snapshot.
0
 
LVL 1

Author Comment

by:progjm
ID: 37720936
thank you both, worked like a charm
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

HOW TO: Upload an ISO image to a VMware datastore for use with VMware vSphere Hypervisor 6.5 (ESXi 6.5) using the vSphere Host Client, and checking its MD5 checksum signature is correct.  It's a good idea to compare checksums, because many installat…
In this article, I will show you HOW TO: Create your first Windows Virtual Machine on a VMware vSphere Hypervisor 6.5 (ESXi 6.5) Host Server, the Windows OS we will install is Windows Server 2016.
Teach the user how to use create log bundles for vCenter Server or ESXi hosts Open vSphere Web Client: Generate vCenter Server and ESXi host log bundle:  Open vCenter Server Appliance Web Management interface and generate log bundle: Open vCenter Se…
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…

734 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