Set Perennially Reservation with PowerCLI

I am going to make this one short and sweet.

On a reboot, hosts that have access to RDM LUNs can take a LONG time to reboot. In order to correct to correct this we can set the hosts to have the LUNs perennially reserved.

The only way to set this is by typing(sorry no GUI fix).

In esxcli we see,

esxcli storage core device setconfig -d naa.12345671234982734987 –perennially-reserved=true

(Above I just started typing random numbers, but you get the idea)

In general though you are going to have more than one host in a cluster that have access to the same RDMs. As usual PowerCLI to the rescue.

This script will pull the RDMs from a specific VM and set the Perennially Reserved flag for all the hosts in the cluster.

$vm=get-vm "VM to Set perrenial reservation for"

#Collecting the various pieces of information


#Here I look for Physical RDMs, but you can change it to RawVirtual if you like
$scsinames=$vm|get-harddisk -DiskType RawPhysical


$clihost=get-esxcli -vmhost $scsihost

#Checks the scsinames against the host to see if they are perennially reserved or not
#If Not places them in the variable $devices
$devices= $scsinames|select -expand scsicanonicalname|% {$"$_")}|? {$_.isperenniallyreserved -like "false"}|select -expand device

#ForEach of the hosts, set the device to be perennially reserved.
ForEach ($vmhost in $vmhosts)


$clihost=get-esxcli -vmhost $vmhost
ForEach ($device in $devices)
$$false, "$device", $true)


Hope This Helps!!


P.S. Here is a VMware KB about it as well




Using PowerCLI to Automate SRM Post Power On Commands

Long Title… But first things first. Ben Meadowcroft created several cmdlets and even a module using the SRM API. Having spent a good deal of time in the SRM API myself, let me tell you….IT IS A MESS. Long story short Ben, spent a lot of time creating this really helpful module, and youContinue Reading

vNoob VCAP-DCD Experience

A bit delayed but here it is. I sat the DCD a while at VMworld San Fran. Having never taken an exam at VMworld, this was an entirely new experience for me. Well, the PearsonVue exam experience, was pretty much like any other, I just didn’t realize how much it would affect my VMworld experience. WithContinue Reading

Installing vSphere 6

Installing vSphere 6

Let’s get started installing vCenter. It is never a bad idea to know what screens and information you will need before you get get there! Already this looks SIGNIFICANTLY more streamlined than the vSphere 5.5 installations with SSO, Inventory Service, etc etc etc Next next next! I went with Embedded Deployment, this means everything necessaryContinue Reading

Interconnecting EMC VNX5200

Alright, for my first post back, I created a pretty diagram of the Unified connection scheme for the VNX5200. I found the documentation from EMC, although very good, never had a complete picture of everything once connected. Having to plan it out for my own implementation I decided to share it with you. This ifContinue Reading

And I’m Back!

Hello my three loyal readers. Sorry for the humongous delay in posting. Unfortunately it is really a combination of being really busy at work, and not having any time to play with new stuff. Fortunately I just got a new VNX5200 and a Dell Blade Chassis m1000e I have been installing/configuring/implementing. So all of youContinue Reading

Finding Templates with PowerCLI

Although this doesn’t happen often sometimes I find that I have misplaced a template. I mean that a template I know exists is not in the inventory and I am not sure on which datastore I need to go to re-add it back to the inventory. Granted I don’t personally have many datastores to lookContinue Reading

Lower HIGH Java RAM Usage on vCenter Server

This is especially useful for SMB who don’t have large environments, and can’t throw resources at a vCenter Server This is what one of my vCenter Servers looked like recently To give some insight, this is a vCenter that manages around 3 hosts and 50 VMs. I quickly found a KB about java memory usageContinue Reading

vNoob Learning Puppet

Yes, Puppet has been out for a while now. Yes, I am sure a ton of people already have “Getting Started with Puppet” posts. Well, I am going to do it. I have been wanting to become more familiar with Puppet for a while and just haven’t sat down to do it. Looking at theContinue Reading

Post VMworld Resources

Although VMworld 2014 US is now over, we can still continue to learn from it. Even if you accomplished everything you set out to do at VMworld, there is never a way to do everything there. Or Maybe you didn’t even have a chance to go to VMworld, and feel like you may have missedContinue Reading