none
Remove orphan VMM server from SCVMM is not possible? RRS feed

  • Question

  • Hello, we have an issue where an old VMM server is still appearing as a managedcomputer in SCVMM 2016 Update Rollup 3. Although it doesn't appear in the UI, it does when PS queried.

    PS > Get-SCVMMManagedComputer | ? computername -eq vmm-server

    StateString              : Responding
    RoleString               : Not associated
    State                    : Responding
    VersionState             : UpToDate
    VersionStateString       : Up-to-date
    MarkedForDeletion        : False
    Name                     : vmm-server.domain.com
    MostRecentTaskID         : ba88968b-22aa-42b4-bba2-xxxxxxxxxx8
    MostRecentTaskUIState    : Failed
    MostRecentTask           : Remove infrastructure server
    FullyQualifiedDomainName : vmm-server.domain.com
    FQDN                     : vmm-server.domain.com
    ComputerName             : vmm-server
    Description              : Virtual Machine Manager Library Files
    AgentVersion             : 3.2.8292.0
    Role                     : NotAssociated
    UpdatedDate              : 09/12/2015 11:54:25
    ComplianceStatus         :
    ServerConnection         : Microsoft.SystemCenter.VirtualMachineManager.Remoting.ServerConnection
    ID                       : ba88968b-22aa-42b4-bba2-xxxxxxxxxx8
    IsViewOnly               : False
    ObjectType               : AgentServer
    IsFullyCached            : True

    I tried to remove this and this is what came up.

    PS > Remove-SCVMMManagedComputer -VMMManagedComputer $orphan -Credential $cred

    Remove-SCVMMManagedComputer : vmm-server.domain.com is not an infrastructure server in VMM. Add it as aninfrastructure server and try the operation again. (Error ID: 20560, Detailed Error: )

    At line:1 char:1

    + Remove-SCVMMManagedComputer -VMMManagedComputer $orphan -Credential ( ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : ReadError: (:) [Remove-SCVMMManagedComputer], CarmineException
        + FullyQualifiedErrorId : 20560,Microsoft.SystemCenter.VirtualMachineManager.Cmdlets.RemoveManagedComputerCmdlet

    Anyone knows how to remove this?

    --

    Alex

    Friday, September 1, 2017 9:03 AM

All replies

  • Hello Alex,

    You can try the following command in the PowerShell.

    Get-SCVMHost -ComputerName "Hyper-V host's name" | Remove-SCVMHost –force

    Best regards,

    Andy Liu


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Monday, September 4, 2017 2:20 AM
  • Unfortunately this doesn't work.

    PS > Get-SCVMHost vmm-server
    Get-SCVMHost : vmm-server cannot resolve with DNS. (Error ID: 404, Detailed Error: No such host is known)

    Ensure there is network communication with the DNS server. If the problem persists, contact your network administrator.
        + CategoryInfo          : ReadError: (:) [Get-SCVMHost], CarmineException
        + FullyQualifiedErrorId : 404,Microsoft.SystemCenter.VirtualMachineManager.Cmdlets.GetHostCmdlet

    Should I add a dummy A record in DNS?

    Thanks

    Wednesday, September 6, 2017 9:28 AM
  • Hello Alex,

    It looks like that you are not using the recommended command correctly. You miss the parameter "-ComputerName".

    Please copy and parse the following command to the PowerShell directly, and then replace the "Hyper-V host's name" to your host's name.

    Get-SCVMHost -ComputerName "Hyper-V host's name" | Remove-SCVMHost –force


    Best regards,

    Andy Liu


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.


    Wednesday, September 6, 2017 9:42 AM
  • Hello Andy,

    unfortunately this doesn't solve the issue.

    PS: Get-SCVMMManagedComputer | ? computername -eq orphan_scvmm_server


    StateString              : Responding
    RoleString               : Not associated
    State                    : Responding
    VersionState             : UpToDate
    VersionStateString       : Up-to-date
    MarkedForDeletion        : False
    Name                     : orphan_scvmm_server.company.local
    MostRecentTaskID         : af9620c8-4bdb-4262-a861-38aaaad46acf4
    MostRecentTaskUIState    : Failed
    MostRecentTask           : Remove infrastructure server
    FullyQualifiedDomainName : orphan_scvmm_server.company.local
    FQDN                     : orphan_scvmm_server.company.local
    ComputerName             : orphan_scvmm_server
    Description              : Virtual Machine Manager Library Files

    AgentVersion             : 3.2.8292.0
    Role                     : NotAssociated
    UpdatedDate              : 09/12/2015 11:54:25
    ComplianceStatus         :
    ServerConnection         : Microsoft.SystemCenter.VirtualMachineManager.Remoting.ServerConnection
    ID                       : a7791d65-606b-4827-9da9-091aaaa120d9e
    IsViewOnly               : False
    ObjectType               : AgentServer
    IsFullyCached            : True
    MostRecentTaskIfLocal    : Remove infrastructure server



    PS: Get-SCVMHost -ComputerName "orphan_scvmm_server.company.local" | Remove-SCVMHost –f
    orce
    Get-SCVMHost : orphan_scvmm_server.company.local cannot resolve with DNS. (Error ID: 404, Detailed Error: No such host is
    known)

    Ensure there is network communication with the DNS server. If the problem persists, contact your network administrator.
        + CategoryInfo          : ReadError: (:) [Get-SCVMHost], CarmineException
        + FullyQualifiedErrorId : 404,Microsoft.SystemCenter.VirtualMachineManager.Cmdlets.GetHostCmdlet
    [vmmha]: PS C:\Users\akanakar\Documents>

    --

    Alex

    Thursday, October 5, 2017 1:26 PM
  • Hi guys, any update on this one? I also experience the same issue. Trying to get rid of the non-existence or orphan vmm server from the current SCVMM. I am currently using SCVMM 2012 R2 UR13. I already tried the above recommended powershell command but does not work as well. Any guidance from expert is really appreciate it. Thank you.
    Thursday, April 5, 2018 10:09 AM
    1. Find out the old VMM server ID. Record the ServerID of the old VMM server.

    SELECT * FROM [VirtualManagerDB].[dbo].[tbl_VMM_Server]

    1. Run the following to remove the old VMM server. Please replace the ID in the yellow part.

    EXEC prc_VMM_RemoveVmmServerById 'ServerID'

    Friday, April 6, 2018 2:32 AM
  • Drastic! What is the whole point of the GUI where such simple action cannot be performed?
    Tuesday, December 11, 2018 9:19 PM
  • Same issue here. I had no other choice than use Rex Zhao's script. 
    Friday, June 21, 2019 10:45 AM