
SCarter20181018055340 asked a question.
We have a requirement to delete all Virtual Machines from the ImportedVirtualMachine table which have never been inventoried by FlexNet agent. We have a script (see below) which will give us all the machines without an InventoryDate. We only currently have VMWare & HyperV devices.
select ivm.ComputerName as ImportedComputerName, ivm.virtualmachinetype,cc.computername, vm.FriendlyName, cc.InventoryDate, vm.*
from ImportedVirtualMachine ivm left join VirtualMachine vm
on ivm.uuid = vm.uuid left join compliancecomputer cc
on vm.ComplianceComputerID = cc.ComplianceComputerID
where ivm.VirtualMachineType in ('VMType.VMWare','VMType.HyperV')
and cc.computername is null
order by inventorydate
Any time we delete anything from ImportedVM table it repopulates. We're unsure which underlying table(s) we should be deleting from to ensure the results from the above query are do not repopulate.
We wish to execute this query on a regular basis to ensure we do not have a number of legacy/decomm'd machines within this table as we do currently.
That is due to them still being present in the FNMS Inventory database. You would need to remove them from both the Compliance and Inventory databases.
As @BradAkers has alluded do, deleting data from the Imported* tables in the compliance database normally won't do anything interesting if you don't also delete data from the underlying inventory source database: the next time an import is performed, data from the source database will simply be re-imported and cause the Imported* records to be re-created.
A pattern that you can use to delete computers in the FlexNet inventory database is as follows:
SELECT ComputerIDINTO ComputerFROM dbo.ComputerWHERE <insert condition to identify computers to be deleted>EXEC dbo.DeleteComputersKirk,
As of 2017 R3 I want to say VMs without our full HW/SW scan data will no longer show in the FNMS WebUI. They will only exist in the DB with a status of Awaiting Inventory.
Hi BradAkers
Will the un-inventoried VMs in the VirtualMachineAwaitingInventory database view be removed when they are no longer existing in daily VM host scan via vCenter scan? Why I have this ask is because I found that those un-inventoried VMs related to a specific VM host in the VirtualMachineAwaitingInventory database view didn't exist when browsing the VMs under the specific host in vCenter console.
Thanks