We help IT Professionals succeed at work.
Get Started

Report on all VM's "Power-on Boot Delay" value

CitizenRon
CitizenRon asked
on
1,618 Views
Last Modified: 2012-05-09
I'm using the attached PowerShell code with the VI Toolkit (Snippet ID=710413) that I wrote to report on all virtual machines in my three VICs that have Snapshots.

I found the attached PowerShell code (Snippet ID=710418) that successfully sets the Boot Delay of the matching VMs to 10 seconds and it works fine for setting it.

I've been trying to figure out how to adapt the Boot Delay script to my Reporting script and have it report the Boot Delay value instead of the Snapshot details but I can't seem to figure out the proper way to have the Get-View cmdlet to show the Boot Delay instead of setting it.

Any assistance in this would be greatly appreciated.
Write-Host
$SepBarEqual = "=" * ($Host.UI.RawUI.WindowSize.Width - 1)
$ServerList = "VC1", "VC2", "VC3"
ForEach ($Server in $Serverlist)	{
	Connect-VIServer $Server | Out-Null
	$ServerNameBox = "=     ** "+$Server+" **"+" " * ($Host.UI.RawUI.WindowSize.Width - $Server.Length - 14)+"="
	Write-Host $SepBarEqual -ForegroundColor Cyan
	Write-Host $ServerNameBox -ForegroundColor Cyan
	Write-Host $SepBarEqual -ForegroundColor Cyan
	Get-VM | Get-Snapshot | Format-Table VM, Created, Name, Description -auto
}
Write-Host

Open in new window

$value = "10000"
Get-VM vm-KMSTest* | ForEach {
	$vm = Get-View $_.Id
	$vmConfigSpec = New-Object VMware.Vim.VirtualMachineConfigSpec
	$vmConfigSpec.BootOptions = New-Object VMware.Vim.VirtualMachineBootOptions
	$vmConfigSpec.BootOptions.BootDelay = $value
	$vm.ReconfigVM_Task($vmConfigSpec)
}

Open in new window

Comment
Watch Question
PowerShell Developer
CERTIFIED EXPERT
Top Expert 2010
Commented:
This problem has been solved!
Unlock 1 Answer and 5 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE