Skip to main content
SnapCenter 6.0 cmdlets

Get-SdVM

Contributors

Lists Hyper-V VMs and their attributes.

Syntax

Get-SdVM [-NoStorage]  <>  [-GetHyperVSnapshot]  <>  [-Name]  <String[]>  [-ComputerName]  <String[]>  [-Session]  <String>  [-Host]  <String>

Detailed Description

Lists Hyper-V VMs and their attributes.Related cmdlets: Get-SdStorage

Parameters

Name Description Required? Pipeline Input Default Value

NoStorage

Specifies that you do not want to get the Data ONTAP storage footprint of a share or mount.

false

false

GetHyperVSnapshot

Specifies that you want to get the Snapshot VHDs, the GUIDs associated with them, and the parent VHD.

false

false

Name

Specifies the name or GUID of the VM you want to get.

false

true (ByPropertyName)

ComputerName

Indicates the name of the Hyper-V server on which you want the VMs to be returned.

false

true (ByPropertyName)

Session

false

true (ByPropertyName)

Host

Specifies the name or IP address of the host on which you execute the operation. The default is your local machine.

false

true (ByPropertyName)

Examples

Example 1: Listing all HyperV VMs

 PS C:\> Get-SdVM

This example syntax lists all Hyper-V VMs and their attributes.

ComputerName Name Guid State Clustered VirtualDisks
------------ ---- ---- ------- --------- ------------
clab-a8-7 vm1 94734822-f2a2-4ddb-9794-8139bc1efb0b Running false {\\vs1\share1\vm1\vm1.vhd}
clab-a8-8 vm2 d68f7d2a-31cd-437d-a435-e8757e730a01 Off true {\\vs2\share1\vm2\vm2.vhd}

Example 2: Listing all HyperV VMs on a specific HyperV server

 PS C:\> Get-SdVM -ComputerName "clab-a8-8"

This examples syntax lists all Hyper-V virtual machines on Hyper-V server clab-a8-8.

ComputerName Name Guid State Clustered VirtualDisks
------------ ---- ---- ------- --------- ------------
clab-a8-8 vm2 d68f7d2a-31cd-437d-a435-e8757e730a01 Off true {\\vs2\share1\vm2\vm2.vhd}
clab-a8-8 vm3 d68f7d2a-31cd-437d-a435-e8757e730a02 Off false {\\vs2\share2\vm3\vm3.vhd}

Example 3: Getting the attributes for a VM

 PS C:\> Get-SdVM -Name vm1 |fl

This example syntax gets the attributes of VM vm1.

Owner   : clab-a8-7
Guid: 94734822-f2a2-4ddb-9794-8139bc1efb0b
State   : Running
StorageType : NAS
SnapShotAttributes  : SnapDrive.Nsf.Interfaces.Virtualization.SnapShotAttributes
ConfigurationAttributes : SnapDrive.Nsf.Interfaces.Virtualization.VMConfigurationAttributes
HighlyAvailable : False
HAAttributes: SnapDrive.Nsf.Interfaces.Virtualization.HighAvailabilityAttributes
StorageFootPrints   : {HostResource : \\vs1_cifs\vol2_share StorageSystemResource : vs1:/vol/vol2/}
VirtualDisks: {\\vs1\share1\vm1\vm1.vhd}
Type: SDHyperv
Name: vm1

Example 4: Showing the virtual disks on a VM

 PS C:\> (Get-SdVM sqltest-vm-01).VirtualDisks

This example syntax lists the virtual disks associated with VM sqltest-vm-01.

Name   : sqltest-vm-01.vhdx
Type   : SDHyperv
VirtualDisk Location   : \\10.53.14.233\r2
VirtualDisk FullPath   : \\10.53.14.233\r2\sqltest-vm-01\Virtual Hard Disks\sqltest-vm-01.vhdx
StorageSystemResource  : sqltest-vsim1-bsd.sim.Company.com:/vol/vol2/
StorageSystemResource Type : SDStorageDir
HostResource   : \\10.53.14.233\r2
HostResource Type  : SDSMBShare
BootDisk   : True

Example 5: Showing all virtual disks and Snapshot copies on a VM

 PS C:\> (Get-SdVm -GetHyperVSnapshot vm_clus_smb4).VirtualDisks

This example syntax lists all the virtual disks including the Hyper-V Snapshot copies associated with VM vm_clus_smb4.

Name   : vm_clus_smb4.vhdx
Type   : SDHyperv
VirtualDisk Location   : \\172.17.175.82\vol3_share
VirtualDisk FullPath   : \\172.17.175.82\vol3_share\vm_clus_smb4\Virtual Hard Disks\vm_clus_smb4.vhdx
StorageSystemResource  : vs2:/vol/vol3/
StorageSystemResource Type : SDStorageDir
HostResource   : \\172.17.175.82\vol3_share
HostResource Type  : SDSMBShare
BootDisk   : True
Name   : vm_clus_smb4_0F10EBD9-01F5-4546-9A99-49CF2EEAA755.avhdx
Type   : SDHyperv
VirtualDisk Location   : \\172.17.175.82\vol3_share
VirtualDisk FullPath   : \\172.17.175.82\vol3_share\vm_clus_smb4\Virtual Hard Disks\vm_clus_smb4_0F10EBD9-01F5-4546-9A99-49CF2EEAA755.avhdx
StorageSystemResource  : vs2:/vol/vol3/
StorageSystemResource Type : SDStorageDir
HostResource   : \\172.17.175.82\vol3_share
HostResource Type  : SDSMBShare
BootDisk   : True