Something i struggled with in the past is setting the productlocker, hassle with scripts and ssh and avoiding host reboots. Today we had to configure another 20 hosts with this and i was pointed to a solution doing it with the MOB. So my next thing was, how to automate this. And with 2 simple foreach loops you can set it and check it and be done!

Setting all hosts from a cluster with a specific path for the productlocker

$allhosts = get-cluster "clustername" | get-vmhost

foreach ($hostname in $allhosts){
Get-VMhost -Name $hostname | %{$_.ExtensionData.UpdateProductLockerLocation_Task("/vmfs/volumes/pathname")}
}

Query all hosts in a cluster to check what location is set

$allhosts = get-cluster "clustername" | get-vmhost

foreach ($hostname in $allhosts){
Get-VMhost -Name $hostname | %{$_.ExtensionData.QueryProductLockerLocation()}
Write-Host $hostname -ForegroundColor Green
}

The original article was posted on: www.hollebollevsan.nl

Related articles

  • Cloud Native
  • Application Navigator
  • Kubernetes Platform
  • Digital Workspace
  • Cloud Infrastructure
  • ITTS (IT Transformation Services)
  • Managed Security Operations
  • Multi-Cloud Platform
  • Backup & Disaster Recovery
Visit our knowledge hub
Visit our knowledge hub
Paul van Dieën Virtualization Consultant

Let's talk!

Knowledge is key for our existence. This knowledge we use for disruptive innovation and changing organizations. Are you ready for change?

"*" indicates required fields

First name*
Last name*
Hidden