|
|
Data ONTAP® PowerShell Toolkit
|
Cmdlet: ConvertTo-NcVhd
NAME
ConvertTo-NaVhd
SYNOPSIS
Convert a VMDK file, a VHDX file, a dynamic VHD file, or a Data ONTAP LUN in
to a VHD file.
SYNTAX
ConvertTo-NaVhd [-SourceVmdk] <String> [[-DestinationVhd] <String>] [-Win2k3
ScsiToIde] [-FollowParent] [-Controller <AbstractController>] [<CommonParame
ters>]
ConvertTo-NaVhd -SourceLun <String> [[-DestinationVhd] <String>] [-Controlle
r <AbstractController>] [<CommonParameters>]
ConvertTo-NaVhd -SourceDiskIndex <UInt32> [[-DestinationVhd] <String>] [-Con
troller <AbstractController>] [<CommonParameters>]
ConvertTo-NaVhd -SourceVhd <String> [-ForceHostCopy] [[-DestinationVhd] <Str
ing>] [-Controller <AbstractController>] [<CommonParameters>]
ConvertTo-NaVhd [-SourceVhdx] <String> [[-DestinationVhd] <String>] [-Contro
ller <AbstractController>] [<CommonParameters>]
DESCRIPTION
Convert a VMDK file, a VHDX file, a dynamic VHD file, or a Data ONTAP LUN in
to 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>
).
Note: This cmdlet can convert a VMDK that is being used by a running VM
. Be sure to shutdown the VM or quiesce the filesystem before running t
his cmdlet. Failing to do so may result in an inconsistent or corrupt r
esult.
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
-Win2k3ScsiToIde
Use this switch when converting a Windows Server 2003 SCSI VMDK to VHD.
When specified, the cmdlet will perform the necessary steps to ensure t
he required IDE drivers are present on the virtual disk.
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-FollowParent
If specified, the parser will follow the VMDK parent descriptor and use
the base VMDK for the clone operation.
Required? false
Position? named
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
-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.
A host-based copy will use SCSI XCOPY when available, otherwise data wil
l be copied from the source to the host, then from the host to the desti
nation.
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-SourceVhdx <String>
Absolute path to a VHDX file to convert to a VHD.
Required? true
Position? 1
Default value
Accept pipeline input? true (ByPropertyName)
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
-------------- Example 6 --------------
C:\PS>ConvertTo-NaVhd -SourceVhdx F:\VHDX\disk1.vhdx -DestinationVhd F:\VHD\
disk1.vhd
Convert the disk1.vhdx file into a VHD.
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a--- 8/21/2012 10:32 AM 10770973184 disk1.vhd
RELATED LINKS
ConvertTo-NaVmdk
| Copyright © 2013 NetApp. All rights reserved. Use is subject to license terms. |
|
Data ONTAP® PowerShell Toolkit
|