Workflow for discovery instances of managed Virtual Machine Hosts which are represented in the StruxureWare Operations data model
Knowledge Base article:
Summary
This discovery aggregates information on existing virtual machine hosts from the Virtual Machine Manager service with knowledge of these hosts in the StruxureWare Operations service. The discovery workflow will instantiate objects for all existing virtual machine hosts modeled in StruxureWare Operations and append any location information for these hosts.
$vmmServer = Get-SCVMMServer -ComputerName $vmmServerName -TCPPort $vmmServerPort;
if ($Error.Count -ne 0) {
LogError("Unable to connect to VMM server: " + $Error[0]);
return;
}
# Convert VMM server name from request to fully qualified domain name
$vmmServerName = $vmmServer.FullyQualifiedDomainName;
$vmhosts = Get-SCVMHost -VMMServer $vmmServer;
if ($Error.Count -ne 0) {
LogError("Unable to get information about VM hosts from VMM server: " + $vmmServerName + ": " + $Error[0]);
$vmmServer.Disconnect();
return;
}
$vmclients = Get-SCVirtualMachine -VMMServer $vmmServer;
if ($Error.Count -ne 0) {
LogError("Unable to get information about VM clients from VMM server: " + $vmmServerName + ": " + $Error[0]);
$vmmServer.Disconnect();
return;
}
$message = "StruxureWare Operations PROPack does not support IT Impact with an StruxureWare Operations license only. To enable this feature, make sure you have complete configuration of StruxureWare Operations including a valid StruxureWare Operations: Capacity license.";
$eventLogs = Get-EventLog "Application" | Where-Object {$_.Message -eq $message}
if ($eventLogs -eq $null) {
Get-ISXOInformation $isxoEndPoint $username $password
}
Set-VMHostInformation $ISXOEndpoint $username $password $vmmServer $vmhosts $vmclients
if ($Error.Count -ne 0) {
LogError("Unable to push VM host information to: " + $ISXOEndpoint + ": " + $Error[0]);
$vmmServer.Disconnect();
return;
}
LogInfo("Sent information about " + $vmhosts.Count + " VM host(s) to: " + $ISXOEndpoint);
$knownVMHosts = Get-KnownVMHost $ISXOEndpoint $username $password $vmmServer
if ($Error.Count -ne 0) {
LogError("Unable to get information about known VM hosts for VMM server: " + $vmmServerName + " from: " + $ISXOEndpoint + ": " + $Error[0]);
$vmmServer.Disconnect();
return;
}
LogInfo("Retrieved information about " + $knownVMHosts.Count + " known VM host(s) for VMM server: " + $vmmServerName + " from: " + $ISXOEndpoint);