Skip to main content

How to find corresponded physical disk for Hyper-V CSV volumes

CSV (Cluster Shared Volume) is fundamental of Microsoft Hyper-V. You must have it to leverage Live Migration and High Availability features. But it's very confuse when you want to reclaim CSV since CSV is using different name with physical disks. For example, CSV name usually is "Cluster Disk x", path usually is "C:ClusterStorageVolumeX". But real disk name is "Disk x" in Disk Manager. You have to very carefully when delete the disk.



Here is a way to find corresponded physical disk, hopefully it's can help your work.



  1. Run following PowerShell to find Disk GUID or Disk Signature.
    GPT disk
    PS C:> Get-ClusterSharedVolume -Name "Cluster Disk X"| Get-ClusterParameter -Name DiskIdGuid | Select Value | Format -Table -AutoSize

    MBR disk
    PS C:> Get-ClusterSharedVolume -Name "Cluster Disk X"| Get-ClusterParameter -Name DiskSignature | Select Value | Format -Table -AutoSize

  2. Run diskpart.exe in command prompt.

  3. Run list disk to inventory all attached disks.

  4. Run select disk x to select a disk you want to check. (x is the number of disk listed in step3)

  5. Run Detail disk. The selected disk is actual disk of the CSV if Disk ID matches to the output of step 1.



 *** Chinese Version ***

CSV (Cluster Shared Volume) 是微软Hyper-V的基础。如果你要开启Live MigrationHigh Availability就需要启用CSV。但是CSV的命名和真是的物理磁盘是不同的,这会导致在删除CSV时出现迷惑。例如,CSV名称一般叫"Cluster Disk x",路径一般是"C:ClusterStorageVolumeX",而磁盘管理其中的磁盘名字却是"Disk x"。所以删除磁盘时一定要小心。

以下是查找CSV对应的物理磁盘的方法,希望对你有所帮助。



  1. 运行以下PowerShell命令找Disk GUID 或 Disk Signature。
    GPT磁盘
    PS C:> Get-ClusterSharedVolume -Name "Cluster Disk X"| Get-ClusterParameter -Name DiskIdGuid | Select Value | Format -Table -AutoSize

    MBR磁盘
    PS C:> Get-ClusterSharedVolume -Name "Cluster Disk X"| Get-ClusterParameter -Name DiskSignature | Select Value | Format -Table -AutoSize

  2. 在命令行下运行 diskpart.exe

  3. 运行 list disk 获得所有磁盘列表。

  4. 运行select disk x 选择你要检查的磁盘。(x是第三步中列出的磁盘序列号)

  5. 运行Detail disk。如果Disk ID和第一步中的输出相符,说明这块磁盘就是对应CSV的物理盘。

Popular posts from this blog

Connect-NsxtServer shows "Unable to connect to the remote server"

When you run Connect-NsxtServer in the PowerCLI, it may show "Unable to connect to the remote server".  Because the error message is a little bit confusing with other login issues. It's not easy to troubleshoot. The actual reason is the NSX-T uses a self-signed certificate, and the PowerCLI cannot accept the certificate automatically. The fix is super easy. You need to set the PowerCLI to ignore the invalid certificate with the following command: Set-PowerCLIConfiguration -Scope User -InvalidCertificateAction:Ignore -Confirm:$false

Setup Terraform and Ansible for Windows provisionon CentOS

Provisioning Windows machines with Terraform is easy. Configuring Windows machines with Ansible is also not complex. However, it's a little bit challenging to combine them. The following steps are some ideas about handling a Windows machine from provisioning to post configuration without modifying the winrm configuration on the guest operating system. Install required repos for yum. yum -y install https://repo.ius.io/ius-release-el7.rpm yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm yum -y install https://packages.endpointdev.com/rhel/7/os/x86_64/endpoint-repo.x86_64.rpm yum -y install epel-release yum -y install yum-utils yum-config-manager --add-repo https://rpm.releases.hashicorp.com/RHEL/hashicorp.repo Install  Terraform . sudo yum -y install terraform Install  Ansible . sudo yum -y install ansible Install  Kerberos . yum -y install gcc python-devel krb5-devel krb5-libs krb5-workstation

How to List All Users in Terraform Cloud

Terraform has a rich API. However, the API documentation does not mention how to list all users. We can leverage the organization membership API and the PowerShell command  Invoke-RestMethod  to get a user list. 1. Create an organization token in Terraform Cloud. 2. Create the token variable ( $Token ) in PowerShell. $Token = "abcde" 3. Create the API parameters variable in PowerShell. $params = @{ Uri = "https://app.terraform.io/api/v2/organizations/ZHENGWU/organization-memberships?page%5Bsize%5D=100" Authentication = "Bearer" Token = $Token ContentType = "application/vnd.api+json" } Note: You need to replace ZHENGWU with your own organization name. And I used 100 at the end of the URI to retrieve the first 100 users. It can be any number.  4. Retrieve the API return and list the user's email address. $Test = Invoke-RestMethod @params $Test.data.attributes.email