Compress-SCVirtualDiskDrive

Compress-SCVirtualDiskDrive

Compresses a dynamically expanding virtual hard disk attached to a virtual disk drive.

構文

Parameter Set: Default
Compress-SCVirtualDiskDrive [-VirtualDiskDrive] <VirtualDiskDrive> [-JobGroup <Guid]> ] [-JobVariable <String> ] [-OnBehalfOfUser <System.String> ] [-OnBehalfOfUserRole <Microsoft.SystemCenter.VirtualMachineManager.UserRole> ] [-PROTipID <Guid]> ] [-RunAsynchronously] [ <CommonParameters>]

詳細説明

The Compress-SCVirtualDiskDrive cmdlet compresses a dynamically expanding virtual hard disk attached to a virtual disk drive object to reduce the size of the virtual hard disk. The virtual machine must be stopped before you can compress the virtual hard disk.

You can only use the Compress-SCVirtualDiskDrive cmdlet to compress a Windows-based virtual hard disk (.vhd or .vhdx) file attached to a virtual disk drive object on a virtual machine that is deployed on a Hyper-V host.

A VMware-based virtual hard disk (.vmdk) file on a virtual machine deployed on an ESX Server 3.0 or 3.5 host is fixed, not dynamic, and you cannot compress a fixed virtual hard disk.

A Citrix XenServer-based virtual hard disk (.vhd) file on a virtual machine deployed on a XenServer host is also fixed, not dynamic, and therefore cannot be compressed.

パラメーター

-JobGroup<Guid]>

Specifies an identifier for a series of commands that will run as a set just before the final command that includes the same job group identifier runs.

エイリアス

none

必須?

false

位置は?

named

既定値

none

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-JobVariable<String>

Specifies that job progress is tracked and stored in the variable named by this parameter.

エイリアス

none

必須?

false

位置は?

named

既定値

none

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-OnBehalfOfUser<System.String>

エイリアス

none

必須?

false

位置は?

named

既定値

none

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-OnBehalfOfUserRole<Microsoft.SystemCenter.VirtualMachineManager.UserRole>

エイリアス

none

必須?

false

位置は?

named

既定値

none

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-PROTipID<Guid]>

Specifies the ID of the PRO tip that triggered this action. This allows for auditing of PRO tips.

エイリアス

none

必須?

false

位置は?

named

既定値

none

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-RunAsynchronously

Indicates that the job runs asynchronously so that control returns to the command shell immediately.

エイリアス

none

必須?

false

位置は?

named

既定値

none

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-VirtualDiskDrive<VirtualDiskDrive>

Specifies a virtual disk drive object. You can attach either a virtual hard disk (for a virtual machine on any host) or a pass-through disk (for a virtual machine on a Hyper-V host or an ESX host) to a virtual disk drive object.

エイリアス

none

必須?

true

位置は?

1

既定値

none

パイプライン入力を許可する

True (ByValue)

ワイルドカード文字を許可する

false

<CommonParameters>

このコマンドレットは次の共通パラメーターをサポートします。-Verbose、-Debug、-ErrorAction、-ErrorVariable、-OutBuffer、-OutVariable.詳細については、以下を参照してください。 about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216)。

入力

入力型は、コマンドレットにパイプできるオブジェクトの型です。

出力

出力型は、コマンドレットによって生成されるオブジェクトの型です。

  • VirtualDiskDrive

  • This cmdlet requires a VMM virtual disk drive object that is currently associated with a virtual machine deployed on a host, which can be retrieved by using the Get-SCVirtualDiskDrive cmdlet.

Example Example 1: Compress a virtual hard disk attached to a virtual disk drive on a VM deployed on a host.

The first command gets the virtual disk drive object attached to VM01, and then stores the object in the $VirtDiskDrive variable. This example assumes the virtual machine has only one virtual disk drive and that the virtual hard disk attached to the virtual disk drive is a dynamic virtual hard disk.

The second command compresses the dynamically expanding virtual hard disk that is attached to the virtual disk drive on VM01.

PS C:\> $VirtDiskDrive = Get-SCVirtualDiskDrive -VM (Get-SCVirtualMachine -Name "VM01")
PS C:\> Compress-SCVirtualDiskDrive -VirtualDiskDrive $VirtDiskDrive

関連トピック

Convert-SCVirtualDiskDrive

Expand-SCVirtualDiskDrive

Get-SCVirtualDiskDrive

New-SCVirtualDiskDrive

Remove-SCVirtualDiskDrive

Set-SCVirtualDiskDrive