This discussion has been locked. The information referenced herein may be inaccurate due to age, software updates, or external references.
You can no longer post new replies to this discussion. If you have a similar question you can start a new discussion in this forum.

Multiple unknown Volumes

Hello!

I have been tasked to remove the unknown volumes. The problem is there are about 8000 unknown volumes. What would be the best way to handle this?

Right now I am:

- Looking up the node

- Listing the resources.

- deleting the unknown volumes

- list resources

- verify all the resources I want are being monitored

- submitting

This process works but will take me forever to do. Any help will be appreciated!

Parents
  • This is a script I have for removing "unknown" volumes.

    $SwisConnection = Connect-Swis -Hostname orionserver.demo.local -UserName 'myAdminLevelAccount' -Password 'myC0mpl3xP@ssw0rd'
    
    $UnknownVolumeQuery = @"
    SELECT [V].FullName
         , [V].Uri
    FROM Orion.Volumes AS [V]
    WHERE [V].Status = 0 --Unknown
    "@
    
    $UnknownVolumes = Get-SwisData -SwisConnection $SwisConnection -Query $UnknownVolumeQuery
    
    ForEach ( $UnknownVolume in $UnknownVolumes ) {
        Write-Host "We're going to delete $( $UnknownVolume.FullName) now."
        # Uncomment the below line when you are 100% sure you want to do this work.
        # Remove-SwisObject -SwisConnection $SwisConnection -Uri $UnknownVolume.Uri
    }
    

    Insofar as re-listing the resources, it can be enumerated and imported using the API, but it's more complex and requires a bunch of do..while loops and have be discussed elsewhere.

  • By any chance could I edit this and use it for unknown interfaces?

  • You can use it for whatever you like - except the FROM clause in the query for interfaces would be Oiron.NPM.Interfaces.  The rest of it would be pretty close.  I'm 100% certain that a FullName is an option for Interfaces, so you may need to find a better field for it (and I'm too swamped to check for that right now).

Reply
  • You can use it for whatever you like - except the FROM clause in the query for interfaces would be Oiron.NPM.Interfaces.  The rest of it would be pretty close.  I'm 100% certain that a FullName is an option for Interfaces, so you may need to find a better field for it (and I'm too swamped to check for that right now).

Children
No Data