|
|
Data ONTAP® PowerShell Toolkit
|
Cmdlet: ConvertTo-NaVhd
NAME
ConvertTo-NaVhd
SYNOPSIS
Convert a VMDK file, a dynamic VHD file, or a Data ONTAP LUN into a VHD file
.
SYNTAX
ConvertTo-NaVhd [-SourceVmdk] <String> [[-DestinationVhd] <String>] [-Contro
ller <AbstractController>] [-WhatIf] [-Confirm] [<CommonParameters>]
ConvertTo-NaVhd -SourceLun <String> [[-DestinationVhd] <String>] [-Controlle
r <AbstractController>] [-WhatIf] [-Confirm] [<CommonParameters>]
ConvertTo-NaVhd -SourceDiskIndex <UInt32> [[-DestinationVhd] <String>] [-Con
troller <AbstractController>] [-WhatIf] [-Confirm] [<CommonParameters>]
ConvertTo-NaVhd -SourceVhd <String> [-ForceHostCopy] [[-DestinationVhd] <Str
ing>] [-Controller <AbstractController>] [-WhatIf] [-Confirm] [<CommonParame
ters>]
DESCRIPTION
Convert a VMDK file, a dynamic VHD file, or a Data ONTAP LUN into a VHD file
.
A VMDK file must be of type "vmfs", "monolithicFlat", or "twoGbMaxExtentFlat
".
When converting from a Data ONTAP LUN, the destination VHD file must reside
on a different LUN in the same volume.
The source and destination files must reside inside of a Data ONTAP volume (
accessed using a path starting with /vol/<volname>), a Data ONTAP attached L
UN, or a Data ONTAP CIFS share (accessed using a mapped network drive or a U
NC path starting with \\hostname\<share>). The source and destination files
must reside on the same controller and volume.
If the controller supplied in the Controller parameter is not the controller
containing the files, the cmdlet consults the credentials cache and attempt
s to connect via HTTPS. If credentials are not present in the credentials c
ache, an attempt to connect via RPC is made. If a connection cannot be made
, the cmdlet will fail.
PARAMETERS
-SourceVmdk <String>
Path to the source VMDK file. The VMDK file must be of type "vmfs", "mo
nolithicFlat", or "twoGbMaxExtentFlat". The path can be a path to the f
ile on the controller (starting with /vol/<volname>), a path to the file
on a Data ONTAP mounted LUN, or a path to a Data ONTAP CIFS share (eith
er a mapped network drive or a UNC path starting with \\hostname\<share>
).
Required? true
Position? 1
Default value
Accept pipeline input? true (ByPropertyName)
Accept wildcard characters? false
-DestinationVhd <String>
Path to the destination VHD file. If not supplied, the VHD file will be
created in the same directory as the source VMDK. The file must not ex
ist. The path can be a path to the file on the controller (starting wit
h /vol/<volname>), a path to the file on a Data ONTAP mounted LUN, or a
path to a Data ONTAP CIFS share (either a mapped network drive or a UNC
path starting with \\hostname\<share>).
Required? false
Position? 2
Default value
Accept pipeline input? false
Accept wildcard characters? false
-Controller <AbstractController>
The Data ONTAP controller object, embodied by an NaController object. T
his parameter is returned by the Connect-NaController cmdlet. If not sp
ecified, the value in the global variable CurrentNaController is used.
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
-SourceLun <String>
Path of a LUN to convert to a VHD file. Must start with /vol/<volname>/
. The following LUN types are supported: windows_2008, hyper_v, linux,
aix, hpux, netware, vmware, xen
Required? true
Position? named
Default value
Accept pipeline input? true (ByPropertyName)
Accept wildcard characters? false
-SourceDiskIndex <UInt32>
A Windows disk index of the disk to convert to a VHD. The disk index mu
st reference a Data ONTAP LUN or the cmdlet will fail.
Required? true
Position? named
Default value
Accept pipeline input? true (ByPropertyName)
Accept wildcard characters? false
-SourceVhd <String>
Absolute path to a dynamic VHD file to convert to a fixed VHD file.
Required? true
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-ForceHostCopy
If specified, the cmdlet will not attempt to offload any of the copying
associated with converting a dynamic VHD to a fixed VHD to Data ONTAP.
Required? false
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>ConvertTo-NaVhd E:\Windows7_VM1.vmdk
Converts the VMDK file to a VHD file. The VHD file will be named "Windows7_
VM1.vhd".
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a--- 11/22/2011 10:30 AM 30064771584 Windows7_VM1.vhd
-------------- Example 2 --------------
C:\PS>ConvertTo-NaVhd \\benson\vol4\VMDKs\Windows7.vmdk \\benson\vol4\VHDs\W
indows7.vhd
Converts the VMDK file on the vol4 share on benson into a VHD file.
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a--- 11/22/2011 10:44 AM 30064771584 Windows7.vhd
-------------- Example 3 --------------
C:\PS>ConvertTo-NaVhd /vol/vol4/VMDKs/Windows7.vmdk /vol/vol4/VHDs/Windows7.
vhd
Performs the same conversion as example 2, except it uses the direct path on
the controller to the file. This is useful if there is no CIFS share provi
ding access to the VMDK file.
Name Type Size Created
Modified Owner Group Perm Empty
---- ---- ---- -------
-------- ----- ----- ---- -----
/vol/vol4/VHDs/Windows7.vhd file 28 GB 11/22/2011
11/22/2011 0 0 1077
-------------- Example 4 --------------
C:\PS>ConvertTo-NaVhd -SourceDiskIndex 2 -DestinationVhd E:\fromLUN.vhd
Convert the LUN that is presented as disk 2 into a VHD file.
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a--- 2/10/2012 2:33 PM 21474836992 fromLUN.vhd
-------------- Example 5 --------------
C:\PS>ConvertTo-NaVhd -SourceVhd E:\dynamic.vhd -DestinationVhd E:\fixed.vhd
Convert the dynamic VHD into a fixed VHD.
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a--- 2/10/2012 2:44 PM 4294967808 fixed.vhd
RELATED LINKS
ConvertTo-NaVmdk
| Copyright © 2012 NetApp. All rights reserved. Use is subject to license terms. |
|
Data ONTAP® PowerShell Toolkit
|