spacer

Veeam Webinar with Doug Hazelman: 5 Steps to Successful Backup & Replication for Hyper-V! Watch it now >>

Restoring the default vCenter Server alarms

Feb 7th, 2012
by Arnim van Lieshout.
No comments yet

I’ve been troubleshooting some vCenter alarms lately, which involved a lot of editing, removing and adding of alarms. After the troubleshooting I wanted to reset everything back to default and ran into VMware KB article 2009166, explaining how to restore the default vCenter Server alarms.

To restore the default vCenter Server alarms you first have to delete all existing alarms, including the custom created alarms. Be warned that the restore procedure from the KB article will restore only the default vCenter Server alarms and not the custom created ones.

Backing up Alarms

When you’ve created a lot of custom alarms then KB Article 1032660 provides a way to backup your alarms by copying the alarms to another (temporary) vCenter server. Using the same procedure you can restore your custom alarms again and guess what? It’s done using a PowerCLI script spacer

Deleting Alarms

As per KB article:
To delete all the existing alarm definitions in the vCenter Server:

  1. Log in to the vCenter Server using the vSphere Client.
  2. Click the Hosts and Clusters view.
  3. Click the Alarms tab.
  4. Click Definitions.Note: All custom alarms must be manually recreated after they are removed. Ensure to note the custom alarms before removing.
  5. Select all alarms, right-click, and  click Remove.

Note: ALL vCenter Alarms need to be removed on ALL objects, not just only the alarms on the vCenter object.

Deleting Alarms using PowerCLI

When you’ve created alarms on different objects, going through the GUI deleting all of them might be a tedious task. You can easily remove all vCenter Server alarms using PowerCLI with just a one-liner regardless of the object the alarm is defined on.

Get-AlarmDefinition | %{$_.ExtensionData.RemoveAlarm()}

Restoring the Default Alarms

As per KB article:
To restore the default vCenter Server alarms, change the alarm version in vCenter Server:
  1. Connect to vCenter Server using the vSphere Client.
  2. Click Administration > vCenter Server Settings.
  3. Click Advanced Settings.
  4. Set alarm.version to 0.
  5. Set alarms.upgraded to false.
  6. Restart the VMware VirtualCenter Server service.

Creating Custom Alarms

If you’re interested in creating custom alarms then the document available at communities.vmware.com/docs/DOC-12145 is a great read.

Posted in: PowerShell, Scripts.
Tagged: PowerCLI · Scripts · vCenter · VMware

PowerCLI automation: Create vCenter Notification Email Alarm Action

Jan 31st, 2012
by Arnim van Lieshout.
No comments yet

I’ve received a request from a customer recently who wanted to configure all vCenter alarms to send a notification email. This instantly made me decide that PowerCLI was the best way to go rather than wasting a lot of valuable time in the vSphere client configuring the email notification alarms.

PowerCLI Automation Script:

I’ve created a quick and dirty script to do the job that I wanted to share with you. It’s probably not the fastest or the best optimized script, but it got the job done.

Get-AlarmDefinition | %{
   $_ | Set-AlarmDefinition -ActionRepeatMinutes (60 * 24);
   $_ | New-AlarmAction -Email -To "vcenteralerts@bwinparty.com" | %{
      $_ | New-AlarmActionTrigger -StartStatus "Green" -EndStatus "Yellow" -Repeat
      $_ | Get-AlarmActionTrigger | ?{$_.repeat -eq $false} | Remove-AlarmActionTrigger -Confirm:$false
      $_ | New-AlarmActionTrigger -StartStatus "Yellow" -EndStatus "Red" -Repeat
   }
}

Line 1: The script first retrieves all the alarms. You can easily adapt the script to update only a specific alarms by changing this line to include the name of the alarm you want to update like:

Get-AlarmDefinition "Datastore usage on disk"

or even all datastore alarms with:

Get-AlarmDefinition "Datastore*"

Line 2: The script then configures the alarm action repeat frequency to repeat the action every 24 hours. The value must be specified in minutes and the default value is to repeat every 5 minutes.

Line 3: On this line a new send notification email action is created to send an email to the email address vcenteralarms@customer.corp.

Line 4: This creates an alarm action trigger when the status changes from “Green” to “Yellow” or from “Normal” to “Warning”.

Line 5: During the creation of the send notification email alarm action, a default alarm action trigger is created. Because there’s currently no Set-AlarmActionTrigger cmdlet available, I decided that it’s easier to remove the default trigger rather than trying to change it from “Once” to “Repeat” by falling back to using the SDK methods. I warned you that it was quick and dirty spacer

Line 6: finally this line creates an alarm action trigger when the status changes from “Yellow” to “Red” or from “Warning” to “Alert”.

Have Fun!

Posted in: PowerShell, Scripts, VMware.
Tagged: PowerCLI · Scripts · vCenter

Top Bloggers Voting Time Again

Jan 24th, 2012
by Arnim van Lieshout.
No comments yet

Eric Siebert has opened up another top VMware & virtualization blogs poll over at vSphere-land.com.  Please take a moment and cast your vote  for your favourite 10 bloggers.  It’ll take only a couple of minutes of your time and you can win a copy of the Train Signal’s new vSphere 5 and View 5 video training courses.

So head on over to vote.vsphere-land.com to cast your vote and reward the best bloggers for their hard work and dedication by letting them know that you appreciate them. They deserve it!

Posted in: Uncategorized.
Tagged: VMware

PHD Virtual Backup and Replication 5.3

Nov 10th, 2011
by Arnim van Lieshout.
No comments yet

PHD Virtual Backup and Replication 5.3, earlier demonstrated at VMworld 2011 by PHD Virtual, is coming soon. According to PHD Virtual it will be offering even faster backup and restore of virtual machines and new technologies that offer more flexibility for disaster recovery of your virtual environment.

NEW FEATURES

  • New Job Processing Engine with I/O optimizations
  • Up to 8 Concurrent Data Streams per VBA (Enterprise Edition)
  • Virtual Machine Replication
  • Virtual Machine Test Mode
  • Mass Restore Virtual Machines
  • Open Export of VM’s from Backup Storage to standard OVF
  • Tape Friendly Backup Support

For more information have a look at the PHD5.3 Datasheet or watch the recently released demo video below.

Posted in: Tools.
Tagged: Backup · Tools · vSphere

Masking LUN paths using PowerCLI

Jul 27th, 2011
by Arnim van Lieshout.
4 comments

I got a question on my previous post about the Get-EsxCli cmdlet, ESXCLI the PowerCLI way, from Alasdair Carnie who was having trouble using the Get-EsxCli cmdlet to mask luns at the ESXi host level. In this post I’ll show you how to accomplish LUN masking at the ESXi host level.

Note 1:
Before you read any further, please notice that the Get-EsxCli cmdlet is experimental. Also notice that in order to retrieve an esxcli instance you have to be connected directly to an ESX host.

Note 2:
When using the esxcli methods in PowerCLI, remember that you pay close attention to the definition of the specific method. You always have to provide a value for every parameter. If you don’t need to provide a value for a specific parameter, you have to specify the $null value.

Now that we are aware of these requirements, let’s create an additional claimrule to mask a LUN at the ESXi host level. Before we create a new claimrule, we’re going to have a look at the running claimrules on the ESXi host first.

Continue reading →

Posted in: ESX, PowerShell, VMware.
Tagged: ESXi · PowerCLI · Storage · VMware

Managing VMware DRS rules using PowerCLI

Jun 21st, 2011
by Arnim van Lieshout.
6 comments

One of the core features of VMware vSphere is the Distributed Resource Scheduler (DRS). VMware DRS is vSphere’s workload load balancer and relies on VMware vMotion technology to live-migrate workloads from one ESX host to another.

You can constrain the VMware DRS decisions by defining DRS Rules. As of vSphere 4.1 there are 2 type of DRS rules:

  • VM-to-VM rules
  • VM-to-Host rules (new in vSphere 4.1)

VM-to-VM rules

Until vSphere 4.1 you could only create VM-to-VM rules. This type of rule specifies the affinity between virtual machines (VMs). You can define both affinity- and anti-affinity rules.

Affinity rules

Affinity rules keep workloads together on the same ESX host. This is beneficial if for instance an application server needs fast access to its database that resides on another VM. Keeping both VMs together on the same host boosts performance as network traffic between the VMs won’t leave the ESX host. Note that if both servers are in different VLANs or subnets this benefit could be undone, as network traffic might need to be routed externally.

Anti-affinity rules

Anti-affinity rules separate workloads on different ESX hosts. This is beneficial if you have services running on multiple servers for redundancy, like domain controllers or Network Load Balancing (NLB) clusters. In these situations you want to make sure that the VMs are distributed over different ESX hosts. If one ESX host fails, the service would still be available through other VM(s) residing on other ESX hosts.

Continue reading →

Posted in: PowerShell, Scripts, VMware.
Tagged: DRS · PowerCLI · Scripts · VMware

Living the dream

May 16th, 2011
by Arnim van Lieshout.
14 comments

Who would’ve thought that 2011 would become such a great year for me? Earlier this year a dream came true with the release of our PowerCLI book on March 28th. Now, only 2 months after, another dream is about to happen. I think I can honestly say that I’m living my dream right now.

Well, it’s official.
I will be joining VMware as a Senior Consultant starting June 6th.

After almost 13 years, I’m leaving my current employer KEMBIT. During that period KEMBIT has always felt like family to me, so deciding to leave them was not that easy. On the other hand, working for VMware was something I could only dream about and I simply couldn’t refuse the offer. spacer

I want to thank KEMBIT for the opportunity to let me grow my VMware knowledge and for their support and understanding. Thanks guys, it was a blast.

Posted in: Uncategorized.
Tagged: VMware

The PowerCLI Book Raffle – Behind the scenes

Apr 18th, 2011
by Arnim van Lieshout.
No comments yet

Now that our PowerCLI Book Raffle has ended and the lucky winner is published, I want to give you a full disclosure of the drawing process. Because our PowerCLI Book is about PowerCLI, what other tool than PowerShell could we use to perform the drawing process?

Twitter Fun

So first we need to retrieve all the twitter messages that people re-tweeted on Twitter. In order to do that we need to call the HTTP based Twitter search API. For more information on how to use the Twitter search API have a look at search.twitter.com/api/ This page shows us that the Twitter search API supports the Atom format through the Atom service URL “search.twitter.com/search.atom?q=<query>”. It also shows us the supported URL parameters. The most important parameters are:

  • rpp: the number of tweets to return per page, up to a max of 100
  • page: the page number to return, up to a max of roughly 1500 results (based on rpp * page

In order to perform a simple search, we only need to fill in the query parameter. We are interested in all messages that contain both “powerclibook” and “magictweet”. In order to search for tweets that contain both words, we need to concatenate them with the plus (+) sign, like search.twitter.com/search.atom?q=powerclibook+magictweet. To see the results you could simply paste that URL into your browser.
spacer    

Continue reading →

Posted in: PowerShell, Scripts.
Tagged: PowerCLI · Scripts · Twitter

VMware vSphere PowerCLI Reference: Automating vSphere Administration

Mar 28th, 2011
by Arnim van Lieshout.
2 comments

spacer It has been quite a journey, but it has finally arrived. Today our book: “VMware vSphere PowerCLI Reference: Automating vSphere Administration” will be released by Sybex. The journey started about a year ago when Alan Renouf and Luc Dekens decided to write a PowerCLI book that should have a practical approach to vSphere administration. Later that year they contacted 3 co-authors to help them out in order to keep meeting the deadlines. The PowerCLI book team was born and the book was to be written by “4 vExperts and a MVP”.

From this point I would like to personally thank Alan and Luc for the opportunity to realize a dream. I would also like to personally thank Mary Ellen Schutz, Developmental Editor, for transforming my technical gibberish into readable and most importantly understandable language. Last but not least I would like to personally thank our Technical Editor, Stuart Radnidge. He left no script unturned and served as the gatekeeper, ensuring that any code you find in the book will run the first time, every time. You might think that’s all there is to it, but then you’re wrong. I’ve never written a book before and I was impressed by the number of people that were involved behind the scenes in this book thing. On the Sybex team there were numerous people involved including but not limited to: Editorial Manager, Acquisition Editor, Production Editor, Copyeditor, Indexer, Proofreader and Compositor. Without each of their contributions, this book would have never made it to the presses.

Continue reading →

Posted in: PowerShell, Scripts, VMware.
Tagged: PowerCLI · Scripts · VMware

vSphere Client for iPad – Another step forward in mobile administration

Mar 18th, 2011
by Arnim van Lieshout.
2 comments

spacer Today VMware announced the release of the vSphere Client for iPad. The first great thing is that you can download the vSphere Client for iPad from Apple’s iTunes Store for FREE! The second great thing is that it looks really awesome and the interface is very intuitive.

VMware is taking mobility very seriously as this is their second application specifically for the iPad. Recently VMware released the VMware View Client for iPad. The vSphere Client for iPad isn’t meant to be a fully functional equivalent for the existing Windows client, but allows you to do the most common tasks, according to VMware. With the current release, the functionality offered by the vSphere Client for iPad is:

  • Search for vSphere hosts and virtual machines
  • Monitor the performance of vSphere hosts and virtual machines
  • Manage virtual machines with the ability to start, stop and suspend
  • View and restore virtual machines’ snapshots
  • Reboot vSphere hosts or put them into maintenance mode
  • Diagnose vSphere hosts and virtual machines using built-in ping and traceroute tools

The ability to manage your vSphere environment with a mobile device isn’t new, as VMware already provides the vCenter Mobile Acces (vCMA) virtual appliance. If you’re familiar with this vCMA, you might recognize the vSphere Client for iPad’s functionality. In fact it’s built on top of this vCMA. The vCMA is required in order for the vSphere Client for iPad to function and can be obtained from VMware free of charge at labs.vmware.com/flings/vcma The latest version of the vCMA has now SSL configured by default, to make sure your connection is secure. Because you connect to the vCMA virtual appliance using standard SSL, you can easily use the vSphere Client for iPad to connect to the vCMA through a firewall to manage your vSphere environment.

Continue reading →

Posted in: Tools, VMware.
Tagged: iPad · Tools · vCenter · VMware

← Earlier Posts
  • Subscribe to our Feed via RSS
  • VMware Related Search
    Custom Search