Log Insight: Missing OVF Properties

As you probably know, the Log Insight virtual appliance relies on OVF properties to handle some amount of configuration. OVF properties are powerful in that they can be set at deploy time, changed at a later time, and can be used instead of relying on a CLI or needing to write a UI on top of a CLI. With that said, OVF properties have two significant limitations:

  1. They require vSphere — not an issue for Log Insight as it is only available as a virtual appliance
  2. They can go missing

The issue of missing OVF properties is what I would like to cover in this post. Read on to learn more!

Log Insight OVF Properties

The number of Log Insight OVF properties have increased over time:

  • 1.0
    • vami.hostname.VMware_vCenter_Log_Insight
    • vami.ip0.VMware_vCenter_Log_Insight
    • vami.netmask.VMware_vCenter_Log_Insight
    • vami.gateway.VMware_vCenter_Log_Insight
    • vami.nameservers.VMware_vCenter_Log_Insight
  • 2.5
    • vm.rootpw
  • 3.0
    • vm.sshkey
  • 3.3
    • vami.dnssearchpath.VMware_vCenter_Log_Insight
    • vami.dnsdomain.VMware_vCenter_Log_Insight

As you can see, they are focused primarily around network configuration, but also have a few options around CLI authentication. The options specified in the OVF properties are the only supported way to configure these options in Log Insight. Put another way, it is not supported to make these changes manually via the CLI (i.e. through the operating system).

OVF Properties and ESXi

vCenter Server and everything on top of vCenter Server (e.g. vCloud Director) understand and persist OVF properties. ESXi understands OVF properties, but has no way to persist them. If you are interested in injecting OVF properties into Log Insight when deploying directly to ESXi see William’s post.

Missing OVF Properties

Now we get to the fun part — when OVF properties go missing. There are two different ways you may notice OVF properties missing:

  1. All OVF properties are missing — OVF properties are stored in the vCenter Server database. This means if the vCenter Server database is cleared or if an ESXi host containing Log Insight is removed and re-added to vCenter Server then the OVF properties will be lost (more information can be found here). The only option in these cases is to recreate the OVF properties.
  2. Some OVF properties are missing — Upgrading Log Insight does NOT add any new OVF properties to your existing virtual appliances. The reason for this is because a Log Insight upgrade can only make changes at the guest level. OVF properties are set at the host level and Log Insight does not have access to make host changes (even if vSphere integration is configured). This means if you have upgraded from Log Insight 1.0 to Log Insight 4.3 then you do not have the new OVF properties introduced in Log Insight 2.5, 3.0, and 3.3 as outlined above. The good news is you can apply the same workaround as missing OVF properties — you can create new ones.

Creating New OVF Properties

To create missing OVF properties you have a couple of options:

  • Create them manually through the UI — these steps are outlined in the vSphere documentation
  • Create them automatically via PowerCLI

For the PowerCLI option, you need two pieces of information:

  1. The OVF properties Log Insight requires — already covered above
  2. The Modify-vApp-Properties function from Luk

In short, just wrap the call around the Modify-vApp-Properties function in a for loop with the Log Insight OVF properties like the following:

#Configure Necessary vApp Settings
function Modify-vApp-Properties($myvapp, $propertylabel, $propertyvalue)
{
	$myvapp
	$propertylabel
	$propertyvalue
    $myview = $myvapp | Get-View
	$myvappproperties = $myvapp.ExtensionData.VAppConfig.Property
	$myprop = $myvappproperties | Where {$_.Label -match $propertylabel}
	$myprop.Value = $propertyvalue
	$spec = New-Object VMware.Vim.vAppConfigSpec
	$newprop = New-Object VMware.Vim.VAppPropertySpec
	$newProp.Operation = "edit"
	$newProp.info = $myprop
	$spec.Property += $newProp
	$myview.UpdateVAppConfig($spec)
}
#Sample on how to use it
$myhwsvapp = Get-VApp | Where {$_.name -match "LogInsight"}
$hash = @{
   vami.hostname.VMware_vCenter_Log_Insight = "loginsight.sflanders.net"
   vami.ip0.VMware_vCenter_Log_Insight = "172.16.16.100"
   vami.netmask.VMware_vCenter_Log_Insight = "255.255.255.0"
   vami.gateway.VMware_vCenter_Log_Insight = "172.16.16.1"
   vami.nameservers.VMware_vCenter_Log_Insight "172.16.16.2,172.16.16.3"
   vami.dnssearchpath.VMware_vCenter_Log_Insight = "sflanders.net"
   vami.dnsdomain.VMware_vCenter_Log_Insight = "sflanders.net"
   vm.rootpw = "ThisIsNotSecure"
   vm.sshkey = ""
}
foreach ($h in $hash.GetEnumerator()) {
   Modify-vApp-Properties -myvapp $myhwsvapp -propertylabel "$($h.Name)" -propertyvalue "$($h.Value)"
}

That’s it! You now have your OVF properties.

© 2017, Steve Flanders. All rights reserved.

Leave a Reply

Your email address will not be published. Required fields are marked *

Back To Top