|
|
Data ONTAP® PowerShell Toolkit
|
Cmdlet: Set-NaVirtualDiskSize
NAME
Set-NaVirtualDiskSize
SYNOPSIS
Resize a VHD file that resides on a Data ONTAP LUN.
SYNTAX
Set-NaVirtualDiskSize [-FullName] <String> [-Size] <String> [-Preserve] [-Wh
atIf] [-Confirm] [<CommonParameters>]
Set-NaVirtualDiskSize [-FullName] <String> -Minimum [-Preserve] [-WhatIf] [-
Confirm] [<CommonParameters>]
DESCRIPTION
Resize a VHD file that resides on a Data ONTAP LUN. The cmdlet supports bot
h growing and shrinking VHD files. If necessary, the NTFS file system insid
e the VHD is resized.
The new VHD size must be between 12 MB and 2040 GB in size. Any blocks adde
d or removed are zeroed on the Data ONTAP storage controller using block dea
llocation. So growing the VHD file consumes no space until additional data
is written to it, and shrinking the VHD file reclaims all of the removed spa
ce.
The file to be resized must be specified with a fully-qualified path that re
sides on a Data ONTAP LUN. Cluster-shared volumes (CSVs) are supported. Ad
ministrator privileges are required to use this cmdlet.
PARAMETERS
-FullName <String>
The fully-qualified name of the VHD file to be resized.
Required? true
Position? 1
Default value
Accept pipeline input? true (ByValue, ByPropertyName)
Accept wildcard characters? false
-Size <String>
Specify the VHD size using the following format:
[+|-]<number>[k|m|g|t|%]
If a leading '+' or '-' appears, it indicates that the VHD size is to be
increased or decreased (respectively) by the indicated amount, else the
amount is the absolute size to set. The optional trailing 'k', 'm', 'g
', and 't' indicates the desired units, namely 'kilobytes', 'megabytes',
'gigabytes', and 'terabytes' (respectively). The optional trailing '%'
indicates to increase or decrease the size of the VHD by a percentage o
f its current size. If the trailing unit character doesn't appear, then
<number> is interpreted as the number of bytes desired.
Required? true
Position? 2
Default value
Accept pipeline input? true (ByValue, ByPropertyName)
Accept wildcard characters? false
-Preserve
Specify to leave all partitions within the VHD untouched. This is usefu
l if the VHD file contains a non-Windows partition style, such as EXT3.
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-WhatIf
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-Confirm
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-Minimum
Specify to shrink the VHD file as far as possible.
Required? true
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer and OutVariable. For more information, type,
"get-help about_commonparameters".
INPUTS
OUTPUTS
System.IO.FileInfo
NOTES
Category: host
-------------- Example 1 --------------
C:\PS>Set-NaVirtualDiskSize J:\GoldenVM1.vhd +100g
Increase the VHD file 'GoldenVM1.vhd' by 100 GB.
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a--- 8/24/2011 4:46 PM 214748365312 GoldenVM1.vhd
-------------- Example 2 --------------
C:\PS>Set-NaVirtualDiskSize E:\VM1.vhd +10%
Increase the size of VM1.vhd by 10%.
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a--- 8/24/2011 4:46 PM 214748365312 VM1.vhd
RELATED LINKS
New-NaVirtualDisk
Remove-NaHostFile
| Copyright © 2012 NetApp. All rights reserved. Use is subject to license terms. |
|
Data ONTAP® PowerShell Toolkit
|