diff --git a/docset/winserver2025-ps/VMDirectStorage/Add-VMDirectVirtualDisk.md b/docset/winserver2025-ps/VMDirectStorage/Add-VMDirectVirtualDisk.md index 602ee31260..bcd11ef535 100644 --- a/docset/winserver2025-ps/VMDirectStorage/Add-VMDirectVirtualDisk.md +++ b/docset/winserver2025-ps/VMDirectStorage/Add-VMDirectVirtualDisk.md @@ -1,20 +1,23 @@ --- external help file: VMDirectStorage-help.xml Module Name: VMDirectStorage -ms.date: 02/21/2024 +ms.date: 03/28/2025 online version: https://learn.microsoft.com/powershell/module/vmdirectstorage/add-vmdirectvirtualdisk?view=windowsserver2025-ps&wt.mc_id=ps-gethelp schema: 2.0.0 title: Add-VMDirectVirtualDisk +ai-usage: ai-generated --- # Add-VMDirectVirtualDisk -## SYNOPSIS -{{ Fill in the Synopsis }} +## Synopsis -## SYNTAX +Directly attaches a Storage Spaces Direct virtual disk to a virtual machine. + +## Syntax ### ByVMName + ``` Add-VMDirectVirtualDisk [-VMName] [-CimSession ] [[-ControllerType] ] [[-ControllerNumber] ] [-ControllerLocation ] [-VirtualDiskUniqueId ] @@ -22,6 +25,7 @@ Add-VMDirectVirtualDisk [-VMName] [-CimSession ] [[-Con ``` ### ByVM + ``` Add-VMDirectVirtualDisk [-VM] [[-ControllerType] ] [[-ControllerNumber] ] [-ControllerLocation ] [-VirtualDiskUniqueId ] @@ -29,27 +33,72 @@ Add-VMDirectVirtualDisk [-VM] [[-ControllerType] [-ControllerLocation ] [-VirtualDiskUniqueId ] [] ``` -## DESCRIPTION -{{ Fill in the Description }} +## Description + +The **Add-VMDirectVirtualDisk** cmdlet directly attaches a Storage Spaces Direct virtual disk to a +virtual machine. This enables high-performance storage configurations by directly connecting the +virtual disk to the VM. -## EXAMPLES +## Examples + +### Example 1: Attach a virtual disk by using a virtual disk object + +This example gets the Storage Spaces Direct virtual disk object named `Volume01` and the VM object +named `VM1` on `Cluster01`, and then directly attaches the disk to the VM, using the first available +controller and controller location. -### Example 1 ```powershell -PS C:\> {{ Add example code here }} +$VirtualDisk = Get-VirtualDisk -FriendlyName "Volume01" -CimSession "Cluster01" +$vm = Get-VM -Name "VM1" -CimSession "Cluster01" + +Add-VMDirectVirtualDisk -VM $vm -VirtualDiskUniqueId $VirtualDisk.UniqueId ``` -{{ Add example description here }} +### Example 2: Attach a virtual disk by specifying VM name and controller details + +This example attaches the virtual disk with the unique ID `111BBE22FD037E4EB87F366648FBF111` to the +virtual machine named `VM1` at controller 0, location 1. + +```powershell +$parameters = @{ + VMName = "VM1" + ControllerType = "SCSI" + ControllerNumber = 0 + ControllerLocation = 1 + VirtualDiskUniqueId = "111BBE22FD037E4EB87F366648FBF111" +} + +Add-VMDirectVirtualDisk @parameters +``` + +### Example 3: Attach multiple virtual disks to a VM + +This example retrieves all virtual disks with names starting with `Volume0` from the cluster named +`Cluster01` and attaches them to the virtual machine named `VM1`. + +```powershell +$VirtualDisks = Get-VirtualDisk -FriendlyName "Volume0*" -CimSession "Cluster01" +$vm = Get-VM -Name "VM1" -CimSession "Cluster01" + +foreach ($diskID in $virtualdisks) { + Add-VMDirectVirtualDisk -VM $vm -VirtualDiskUniqueId $diskID.UniqueID +} +``` -## PARAMETERS +## Parameters ### -CimSession -{{ Fill CimSession Description }} + +Runs the cmdlet in a remote session or on a remote computer. Enter a computer name, cluster name, or +a session object, such as the output of a `New-CimSession` or `Get-CimSession` cmdlet. The default +is the current session on the local computer. For more information, see +[about_CimSession](/powershell/module/microsoft.powershell.core/about/about_cimsession). ```yaml Type: Microsoft.Management.Infrastructure.CimSession[] @@ -64,7 +113,9 @@ Accept wildcard characters: False ``` ### -ControllerLocation -{{ Fill ControllerLocation Description }} + +Specifies the location on the controller where the virtual disk will be attached. If you don't +specify a controller location, the cmdlet uses the first available location. ```yaml Type: System.Int32 @@ -79,7 +130,9 @@ Accept wildcard characters: False ``` ### -ControllerNumber -{{ Fill ControllerNumber Description }} + +Specifies the number of the controller where the virtual disk will be attached. If you don't specify +a controller number, the cmdlet uses the first available controller. ```yaml Type: System.Int32 @@ -94,7 +147,9 @@ Accept wildcard characters: False ``` ### -ControllerType -{{ Fill ControllerType Description }} + +Specifies the type of controller used by the VM. If you don't specify a controller type, the cmdlet +uses the SCSI controller type, which is the only type supported at this time. ```yaml Type: ControllerType @@ -110,7 +165,9 @@ Accept wildcard characters: False ``` ### -VirtualDiskUniqueId -{{ Fill VirtualDiskUniqueId Description }} + +Specifies the unique ID of the Storage Spaces virtual disk to attach. For example, +`111BBE22-FD03-7E4E-B87F-366648FBF111`. ```yaml Type: System.String @@ -125,7 +182,9 @@ Accept wildcard characters: False ``` ### -VM -{{ Fill VM Description }} + +Specifies a virtual machine object to which the virtual disk will be attached. You can use the +[Get-VM](/powershell/module/hyper-v/get-vm) cmdlet to get the virtual machine object. ```yaml Type: Microsoft.HyperV.PowerShell.VirtualMachine[] @@ -140,7 +199,10 @@ Accept wildcard characters: False ``` ### -VMDriveController -{{ Fill VMDriveController Description }} + +Specifies the drive controller object to which the virtual disk will be attached. You can use the +[Get-VmScsiController](/powershell/module/hyper-v/get-vmscsicontroller) cmdlet to get the drive +controller object. ```yaml Type: Microsoft.HyperV.PowerShell.VMDriveController @@ -155,7 +217,8 @@ Accept wildcard characters: False ``` ### -VMName -{{ Fill VMName Description }} + +Specifies the name of the virtual machine to which the virtual disk will be directly attached. ```yaml Type: System.String[] @@ -170,19 +233,39 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). -## INPUTS +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, +-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, +-WarningAction, and -WarningVariable. For more information, see +[about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## Inputs ### System.String[] +Specifies the name of a virtual machine. + ### Microsoft.HyperV.PowerShell.VirtualMachine[] +Specifies a virtual machine object to which the virtual disk will be attached. You can use the +[Get-VM](/powershell/module/hyper-v/get-vm) cmdlet to get the virtual machine object. + ### Microsoft.HyperV.PowerShell.VMDriveController -## OUTPUTS +Specifies a drive controller object to which the virtual disk will be attached. You can use +the [Get-VmScsiController](/powershell/module/hyper-v/get-vmscsicontroller) cmdlet to get the drive +controller object. + +## Outputs + +### None + +This cmdlet returns no output of its own. + +## Notes + +## Related links -### System.Object -## NOTES +- [Get-VMDirectVirtualDisk](Get-VMDirectVirtualDisk.md) -## RELATED LINKS +- [Remove-VMDirectVirtualDisk](Remove-VMDirectVirtualDisk.md) diff --git a/docset/winserver2025-ps/VMDirectStorage/Get-VMDirectVirtualDisk.md b/docset/winserver2025-ps/VMDirectStorage/Get-VMDirectVirtualDisk.md index 118981f4ba..129d03b3bd 100644 --- a/docset/winserver2025-ps/VMDirectStorage/Get-VMDirectVirtualDisk.md +++ b/docset/winserver2025-ps/VMDirectStorage/Get-VMDirectVirtualDisk.md @@ -1,53 +1,102 @@ --- external help file: VMDirectStorage-help.xml Module Name: VMDirectStorage -ms.date: 02/21/2024 +ms.date: 03/28/2025 online version: https://learn.microsoft.com/powershell/module/vmdirectstorage/get-vmdirectvirtualdisk?view=windowsserver2025-ps&wt.mc_id=ps-gethelp schema: 2.0.0 title: Get-VMDirectVirtualDisk +ai-usage: ai-generated --- # Get-VMDirectVirtualDisk -## SYNOPSIS -{{ Fill in the Synopsis }} +## Synopsis -## SYNTAX +Retrieves information about Storage Spaces Direct virtual disks attached to a virtual machine. + +## Syntax ### ByVMName + ``` Get-VMDirectVirtualDisk [-VMName] [-CimSession ] [[-ControllerType] ] [[-ControllerNumber] ] [-ControllerLocation ] [] ``` ### ByVM + ``` Get-VMDirectVirtualDisk [-VM] [[-ControllerType] ] [[-ControllerNumber] ] [-ControllerLocation ] [] ``` ### ByVMDriveController + ``` Get-VMDirectVirtualDisk [-VMDriveController] [-ControllerLocation ] [] ``` -## DESCRIPTION -{{ Fill in the Description }} +## Description + +The **Get-VMDirectVirtualDisk** cmdlet retrieves information about Storage Spaces Direct virtual +disks attached to a virtual machine. This includes details such as the disk's unique ID, friendly +name, and its location on the controller. + +## Examples + +### Example 1: Retrieve directly attached virtual disks by VM name + +This command retrieves all virtual disks attached to the virtual machine named `VM1` running on the +cluster named `Cluster01`. + +```powershell +Get-VMDirectVirtualDisk -VMName "VM1" -CimSession "Cluster01" +``` + +```Output +VMName ControllerType ControllerNumber ControllerLocation VirtualDiskFriendlyName VirtualDiskUniqueId +------ -------------- ---------------- ------------------ ----------------------- ------------------- +VM1 SCSI 0 1 Volume01 111BBE22FD037E4E... +``` + +### Example 2: Retrieve directly attached virtual disks by VM object + +This command gets the virtual machine object for `VM1` running on `Cluster01` and then retrieves its +directly attached virtual disks. + +```powershell +$vm = Get-VM -Name "VM1" -CimSession "Cluster01" +Get-VMDirectVirtualDisk -VM $vm +``` + +### Example 3: Retrieve virtual disks by drive controller object -## EXAMPLES +This command gets the drive controller object for the virtual machine named `VM1` running on +`Cluster01` and retrieves the directly attached virtual disks. -### Example 1 ```powershell -PS C:\> {{ Add example code here }} +$vm = Get-VM -Name "VM1" -CimSession "Cluster01" +$controller = Get-VMScsiController -VMName "VM1" -CimSession "Cluster01" + +Get-VMDirectVirtualDisk -VMDriveController $controller ``` -{{ Add example description here }} +```Output +VMName ControllerType ControllerNumber ControllerLocation VirtualDiskFriendlyName VirtualDiskUniqueId +------ -------------- ---------------- ------------------ ----------------------- ------------------- +VM1 SCSI 0 1 Volume01 111BBE22FD037E4E... +VM1 SCSI 0 2 Volume02 222BBE22FD037E4E... +``` -## PARAMETERS +## Parameters ### -CimSession -{{ Fill CimSession Description }} + +Runs the cmdlet in a remote session or on a remote computer. Enter a computer name, cluster name, or +a session object, such as the output of a `New-CimSession` or `Get-CimSession` cmdlet. The default +is the current session on the local computer. For more information, see +[about_CimSession](/powershell/module/microsoft.powershell.core/about/about_cimsession). ```yaml Type: Microsoft.Management.Infrastructure.CimSession[] @@ -62,7 +111,9 @@ Accept wildcard characters: False ``` ### -ControllerLocation -{{ Fill ControllerLocation Description }} + +Specifies the location of the virtual disk on the controller. If you don't specify a controller +location, the cmdlet returns virtual disks with any controller location. ```yaml Type: System.Int32 @@ -77,7 +128,9 @@ Accept wildcard characters: False ``` ### -ControllerNumber -{{ Fill ControllerNumber Description }} + +Specifies the number of the controller where the virtual disk is attached. If you don't specify a +controller number, the cmdlet returns virtual disks with any controller number. ```yaml Type: System.Int32 @@ -92,7 +145,9 @@ Accept wildcard characters: False ``` ### -ControllerType -{{ Fill ControllerType Description }} + +Specifies the type of controller used by the VM. If you don't specify a controller type, the cmdlet +uses the SCSI controller type, which is the only type supported at this time. ```yaml Type: ControllerType @@ -108,7 +163,9 @@ Accept wildcard characters: False ``` ### -VM -{{ Fill VM Description }} + +Specifies the virtual machine object for which to retrieve virtual disk information. You can use the +[Get-VM](/powershell/module/hyper-v/get-vm) cmdlet to get the virtual machine object. ```yaml Type: Microsoft.HyperV.PowerShell.VirtualMachine[] @@ -123,7 +180,9 @@ Accept wildcard characters: False ``` ### -VMDriveController -{{ Fill VMDriveController Description }} + +Specifies the drive controller object for which to retrieve virtual disk information. You can use +the [Get-VmScsiController](/powershell/module/hyper-v/get-vmscsicontroller) cmdlet to get the drive controller object. ```yaml Type: Microsoft.HyperV.PowerShell.VMDriveController[] @@ -138,7 +197,8 @@ Accept wildcard characters: False ``` ### -VMName -{{ Fill VMName Description }} + +Specifies the name of the virtual machine for which to retrieve virtual disk information. ```yaml Type: System.String[] @@ -153,19 +213,39 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). -## INPUTS +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, +-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, +-WarningAction, and -WarningVariable. For more information, see +[about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## Inputs ### System.String[] +Specifies the name of a virtual machine. + ### Microsoft.HyperV.PowerShell.VirtualMachine[] +Specifies the virtual machine object for which to get directly attached virtual disks. You can use +the [Get-VM](/powershell/module/hyper-v/get-vm) cmdlet to get the virtual machine object. + ### Microsoft.HyperV.PowerShell.VMDriveController[] -## OUTPUTS +Specifies the drive controller objects for which to get directly attached virtual disks. You can use +the [Get-VmScsiController](/powershell/module/hyper-v/get-vmscsicontroller) cmdlet to get the drive +controller object. + +## Outputs + +### VMDirectVirtualDisk + +Returns objects representing the virtual disks attached to the specified virtual machine. + +## Notes + +## Related links -### System.Object -## NOTES +- [Add-VMDirectVirtualDisk](Add-VMDirectVirtualDisk.md) -## RELATED LINKS +- [Remove-VMDirectVirtualDisk](Remove-VMDirectVirtualDisk.md) diff --git a/docset/winserver2025-ps/VMDirectStorage/Remove-VMDirectVirtualDisk.md b/docset/winserver2025-ps/VMDirectStorage/Remove-VMDirectVirtualDisk.md index 2d1b794237..cff236ff1a 100644 --- a/docset/winserver2025-ps/VMDirectStorage/Remove-VMDirectVirtualDisk.md +++ b/docset/winserver2025-ps/VMDirectStorage/Remove-VMDirectVirtualDisk.md @@ -1,46 +1,75 @@ --- external help file: VMDirectStorage-help.xml Module Name: VMDirectStorage -ms.date: 02/21/2024 +ms.date: 03/28/2025 online version: https://learn.microsoft.com/powershell/module/vmdirectstorage/remove-vmdirectvirtualdisk?view=windowsserver2025-ps&wt.mc_id=ps-gethelp schema: 2.0.0 title: Remove-VMDirectVirtualDisk +ai-usage: ai-generated --- # Remove-VMDirectVirtualDisk -## SYNOPSIS -{{ Fill in the Synopsis }} +## Synopsis -## SYNTAX +Detaches a Storage Spaces Direct virtual disk from a virtual machine. + +## Syntax ### ByVMName + ``` Remove-VMDirectVirtualDisk [-VMName] [-CimSession ] [-ControllerType] [-ControllerNumber] [-ControllerLocation] [] ``` ### ByVirtualDisk + ``` Remove-VMDirectVirtualDisk [-VirtualDisk] [] ``` -## DESCRIPTION -{{ Fill in the Description }} +## Description + +The **Remove-VMDirectVirtualDisk** cmdlet detaches a Storage Spaces Direct virtual disk from a +virtual machine. This operation ensures that the virtual disk is no longer accessible by the VM, +though it doesn't delete the virtual disk itself. + +## Examples + +### Example 1: Remove a virtual disk by specifying VM name and controller details -## EXAMPLES +This command removes the virtual disk located at controller 0, location 1, from the virtual machine +named `VM1`. -### Example 1 ```powershell -PS C:\> {{ Add example code here }} +$parameters = @{ + VMName = "VM1" + ControllerType = "SCSI" + ControllerNumber = 0 + ControllerLocation = 1 +} +Remove-VMDirectVirtualDisk @parameters ``` -{{ Add example description here }} +### Example 2: Remove a virtual disk by using the virtual disk object -## PARAMETERS +This example gets all of the virtual disks directly attached to `VM1` on `Cluster01` and then +removes them. + +```powershell +$VmDirectDisk = Get-VMDirectVirtualDisk -VMName "VM1" -CimSession "Cluster01" +Remove-VMDirectVirtualDisk -VirtualDisk $VmDirectDisk +``` + +## Parameters ### -CimSession -{{ Fill CimSession Description }} + +Runs the command using the specified CIM session. Enter a variable that contains the CIM session, or +a command that creates or gets the CIM session, such as `New-CimSession` or `Get-CimSession`. For +more information, see +[about_CimSession](/powershell/module/microsoft.powershell.core/about/about_cimsession). ```yaml Type: Microsoft.Management.Infrastructure.CimSession[] @@ -55,7 +84,10 @@ Accept wildcard characters: False ``` ### -ControllerLocation -{{ Fill ControllerLocation Description }} + +Specifies the location on the controller of the virtual disk to remove. If you don't specify a +controller location, the cmdlet removes all directly virtual disks attached to the specified +controller. ```yaml Type: System.Int32 @@ -70,7 +102,9 @@ Accept wildcard characters: False ``` ### -ControllerNumber -{{ Fill ControllerNumber Description }} + +Specifies the number of the controller where the virtual disk is attached. If you don't specify a +controller number, the cmdlet removes all directly virtual disks on the specified controller. ```yaml Type: System.Int32 @@ -85,7 +119,9 @@ Accept wildcard characters: False ``` ### -ControllerType -{{ Fill ControllerType Description }} + +Specifies the type of controller used by the VM. If you don't specify a controller type, the cmdlet +uses the SCSI controller type, which is the only type supported at this time. ```yaml Type: ControllerType @@ -101,7 +137,8 @@ Accept wildcard characters: False ``` ### -VirtualDisk -{{ Fill VirtualDisk Description }} + +Specifies the virtual disk object to remove. ```yaml Type: VMDirectVirtualDisk[] @@ -116,7 +153,9 @@ Accept wildcard characters: False ``` ### -VMName -{{ Fill VMName Description }} + +Specifies the name of the virtual machine from which the directly attached virtual disk will be +removed. ```yaml Type: System.String @@ -131,17 +170,33 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). -## INPUTS +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, +-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, +-WarningAction, and -WarningVariable. For more information, see +[about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## Inputs ### System.String +Specifies the name of the virtual machine. + ### VMDirectVirtualDisk[] -## OUTPUTS +Specifies the virtual disk objects to be removed. You can get the virtual disk object by using the +[Get-VMDirectVirtualDisk](Get-VMDirectVirtualDisk.md) cmdlet. + +## Outputs + +### None + +This cmdlet returns no output of its own. + +## Notes + +## Related links -### System.Object -## NOTES +- [Add-VMDirectVirtualDisk](Add-VMDirectVirtualDisk.md) -## RELATED LINKS +- [Get-VMDirectVirtualDisk](Get-VMDirectVirtualDisk.md) diff --git a/docset/winserver2025-ps/VMDirectStorage/VMDirectStorage.md b/docset/winserver2025-ps/VMDirectStorage/VMDirectStorage.md index 36b3efa9cb..25b24f79a0 100644 --- a/docset/winserver2025-ps/VMDirectStorage/VMDirectStorage.md +++ b/docset/winserver2025-ps/VMDirectStorage/VMDirectStorage.md @@ -4,21 +4,29 @@ Help Version: 5.1.0.2025 Locale: en-US Module Guid: 62a0b63f-2a15-415f-919a-a48e87f830cc Module Name: VMDirectStorage -ms.date: 02/21/2024 +ms.date: 03/28/2025 title: VMDirectStorage module +ai-usage: ai-generated --- -# VMDirectStorage Module +# VMDirectStorage module + ## Description -{{ Fill in the Description }} -## VMDirectStorage Cmdlets +The **VMDirectStorage** module provides cmdlets to manage the direct attachment of Storage Spaces +Direct virtual disks to virtual machines (VMs). This allows for high-performance storage +configurations by bypassing the host file system. + +## VMDirectStorage cmdlets + ### [Add-VMDirectVirtualDisk](Add-VMDirectVirtualDisk.md) -{{ Fill in the Description }} + +Attaches a Storage Spaces Direct virtual disk to a virtual machine. ### [Get-VMDirectVirtualDisk](Get-VMDirectVirtualDisk.md) -{{ Fill in the Description }} + +Retrieves information about Storage Spaces Direct virtual disks attached to a virtual machine. ### [Remove-VMDirectVirtualDisk](Remove-VMDirectVirtualDisk.md) -{{ Fill in the Description }} +Detaches a Storage Spaces Direct virtual disk from a virtual machine.