Hyper-V replication remove Disk

Welcome Forums General PowerShell Q&A Hyper-V replication remove Disk

  • This topic has 2 replies, 2 voices, and was last updated 1 year ago by
    Participant
    .
Viewing 1 reply thread
  • Author
    Posts
    • #164421
      Participant
      Topics: 1
      Replies: 1
      Points: 21
      Rank: Member

      Hyper-V 2019, Server 2019

      VM has four VHDXs. Need to remove two from replication.

      Compiled statement:

      Set-VMreplication “Server” -ReplicatedDisks (Get-VMHardDiskDrive “Server” -ControllerType SCSI -ControllerNumber 0 -ControllerLocation 2).

      This will remove Disks from ControllerLocation 0,1,3 But I need to remove from 1 too.

      How would I construct it?

    • #164485
      Senior Moderator
      Topics: 9
      Replies: 1236
      Points: 4,443
      Helping Hand
      Rank: Community Hero

      This will remove Disks from ControllerLocation 0,1,3 But I need to remove from 1 too.

      Confused, can you make this lil more clear ?

      • #165064
        Participant
        Topics: 1
        Replies: 1
        Points: 21
        Rank: Member

        Hi Karunan,

        I was trying to figure out commands to replicate only certain disks after replication is enabled without breaking it.

        Figured it out.

        Command that I used:

        Set-VMreplication “VMname” -ReplicatedDisks (Get-VMHardDiskDrive “VMname” -ControllerType SCSI -ControllerNumber 0 -ControllerLocation 0), (Get-VMHardDiskDrive “VMname” -ControllerType SCSI -ControllerNumber 0 -ControllerLocation 2)

        So to replicate all disks – Set-VMreplication “VMname” -ReplicatedDisks (Get-VMHardDiskDrive “VMname”)

        To replicate only certain disks – add (Get-VMHardDiskDrive “VMname” -ControllerType SCSI -ControllerNumber 0 -ControllerLocation 0) and repeat same line for each disk, changing the location or type or controller depending on your situation. Put a comma between each parantasy.

        Sorry if it’s not clear.

Viewing 1 reply thread
  • The topic ‘Hyper-V replication remove Disk’ is closed to new replies.