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.
if ($Error.Count -ne 0) {
LogError("Unable to create discovery data: " + $Error[0]);
return;
}
$vmmServerObj = Get-SCVMMServer -ComputerName $vmmServer -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 = $vmmServerObj.FullyQualifiedDomainName;
$vmhosts = Get-SCVMHost -VMMServer $vmmServerName;
if ($Error.Count -ne 0) {
LogError("Unable to get information about VM hosts from VMM server: " + $vmmServerName + ": " + $Error[0]);
$vmmServerObj.Disconnect();
return;
}
$vmclients = Get-SCVirtualMachine -VMMServer $vmmServerObj;
if ($Error.Count -ne 0) {
LogError("Unable to get information about VM clients from VMM server: " + $vmmServerName + ": " + $Error[0]);
$vmmServerObj.Disconnect();
return;
}
Set-VMHostInformation $isxoEndpoint $username $password $vmmServerObj $vmhosts $vmclients
if ($Error.Count -ne 0) {
LogError("Unable to push VM host information to: " + $isxoEndpoint + ": " + $Error[0]);
$vmmServerObj.Disconnect();
return;
}
LogInfo("Sent information about " + $vmhosts.Count + " VM host(s) to: " + $isxoEndpoint);
$knownVMHosts = Get-KnownVMHost $isxoEndpoint $username $password $vmmServerObj
if ($Error.Count -ne 0) {
LogError("Unable to get information about known VM hosts for VMM server: " + $vmmServerName + ":" + $vmmServerPort + " from: " + $isxoEndpoint + ": " + $Error[0]);
$vmmServer.Disconnect();
return;
}
LogInfo("Retrieved information about " + $knownVMHosts.Count + " known VM host(s) for VMM server: " + $vmmServerName + ":" + $vmmServerPort + " from: " + $isxoEndpoint);