Monthly Archives: August 2014

Create datastore in 5.5 error Call “HostStorageSystem.ComputeDiskPartitionInfo” for object “storageSystem” on ESXi “HOSTNAME” failed.

I kept getting the error ‘Call “HostStorageSystem.ComputeDiskPartitionInfo” for object “storageSystem” on ESXi “HOSTNAME” failed’ when I attempted to create a datastore  from an old hard drive I had laying around.

Turns out ESXi was failing to format the existing partitions and I had to manually delete the partitions first,

 

Using SSH,

# esxcfg-scsidevs -l

this lists the disk devices, the device file will be /dev/disks/<NAME>

# partedUtil get /dev/disks/t10.ATA_…

this shows the partitions on the device

# partedUtil delete /dev/disks/t10.ATA_… 1

deletes partition 1

Configuring VMware Capacity Planner for IP subnet discovery (2014366)

I had trouble discovering servers on a different subnet so after a little digging, I found the below which did the trick.

http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=2014366

 

After installing the VMware Capacity Planner Datamanager and configuring the system to receive new systems, you can perform these steps to discover systems on an IP subnet:

  1. Open Capacity Planner Data Manager.
  2. Navigate to Admin > Options.
  3. Go to Modules > Discover > Settings.
  4. Deselect the Discover Groups / Domains option.
  5. Under the Node Discovery tab, deselect Lan Manager Systems and Active Directory Systems.
  6. Select DNS Names and IP Address.
  7. Under the System Discovery tab, select the Test Connection to system during discovery option.
  8. Under the IP Subnets tab, click Add.
  9. Add the appropriate Subnet Range by Class or CIDR Notation.
  10. Click Apply.
  11. Click Tasks > Run Manual Tasks > Run Discover Task.The IP subnet that has been configured are pinged and systems are discovered.

Powershell Issues

I was recently working on a script to send an SMTP email reporting on VM’s that only have a certain amount of free guest VM disk space left.

It turns out to use ‘Connect-VIServer’ cmdlet in your PowerShell script. You have to follow two steps:

1) Install VMware PowerCLI in your machine. It will register itself in PowerShell during the installation.

2) Use ‘Add-PSSnapIn VMware.VimAutomation.Core’ to add the registered PowerShell VMware Snapin to the current session.

So essential, the first lines of your script should have the ‘Add-PSSnapIn VMware.VimAutomation.Core’ entry otherwise the native Microsoft PowerShell

will fail due to unknown commands.

For those interested, the script looked like the below.

Add-PSSnapIn VMware.VimAutomation.Core

Connect-VIServer <servername>

$treshold = 10GB

$report = Get-VM | where { $_.PowerState -eq “PoweredOn” -and $_.Guest } | Get-VMGuest | %{
$vm = $_
$_.Disks | where {$_.FreeSpace -le $treshold} | `
select @{N=”VMName”;E={$vm.VMName}},Path,@{N=”DiskFreeGB”;E={[math]::Round((($_.FreeSpace)/1GB),2)}}
}

$emailFrom = <from-email-addr>
$emailTo = <to-email-addr>
$subject = “Free disk space less than ” + ($treshold/1GB) + “GB”
$body = $report | ft -AutoSize | Out-String
$smtpServer = <smtp-server>
$smtp = new-object Net.Mail.SmtpClient($smtpServer)
$smtp.Send($emailFrom, $emailTo, $subject, $body)
A big thank you to LucD on the VMware Communities Forum.