< Back
Add-AzureRmVhd
Post
NAME Add-AzureRmVhd
SYNOPSIS
Uploads a virtual hard disk from an on-premises virtual machine to a blob in a cloud storage account in Azure.
SYNTAX
Add-AzureRmVhd [[-ResourceGroupName] <String>] [-Destination] <Uri> [-LocalFilePath] <FileInfo> [[-NumberOfUploaderThreads] <Int32>]
[[-BaseImageUriToPatch] <Uri>] [[-OverWrite]] [-AsJob] [-DefaultProfile <IAzureContextContainer>] [<CommonParameters>]
DESCRIPTION
The Add-AzureRmVhd cmdlet uploads on-premises virtual hard disks, in .vhd file format, to a blob storage account as fixed virtual hard disks. You
can configure the number of uploader threads that will be used or overwrite an existing blob in the specified destination URI. Also supported is
the ability to upload a patched version of an on-premises .vhd file. When a base virtual hard disk has already been uploaded, you can upload
differencing disks that use the base image as the parent. Shared access signature (SAS) URI is supported also.
PARAMETERS
-AsJob [<SwitchParameter>]
Run cmdlet in the background and return a Job to track progress.
Required? false
Position? named
Default value False
Accept pipeline input? False
Accept wildcard characters? false
-BaseImageUriToPatch <Uri>
Specifies the URI to a base image blob in Azure Blob Storage. An SAS can be specified as the value for this parameter.
Required? false
Position? 4
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-DefaultProfile <IAzureContextContainer>
The credentials, account, tenant, and subscription used for communication with azure.
Required? false
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-Destination <Uri>
Specifies the URI of a blob in Blob Storage. The parameter supports SAS URI, although patching scenarios destination cannot be an SAS URI.
Required? true
Position? 1
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-LocalFilePath <FileInfo>
Specifies the path of the local .vhd file.
Required? true
Position? 2
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-NumberOfUploaderThreads <Int32>
Specifies the number of uploader threads to be used when uploading the .vhd file.
Required? false
Position? 3
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-OverWrite [<SwitchParameter>]
Indicates that this cmdlet overwrites an existing blob in the specified destination URI, if one exists.
Required? false
Position? 5
Default value False
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-ResourceGroupName <String>
Specifies the name of the resource group of the virtual machine.
Required? false
Position? 0
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
None
This cmdlet does not accept any input.
OUTPUTS
Microsoft.Azure.Commands.Compute.Models.VhdUploadContext
NOTES
Example 1: Add a VHD file
PS C:\\> Add-AzureRmVhd -Destination "http://contosoaccount.blob.core.windows ... eimage.vhd" -LocalFilePath "C:\\vhd\\Win7Image.vhd"
This command adds a .vhd file to a storage account.
Example 2: Add a VHD file and overwrite the destination
PS C:\\> Add-AzureRmVhd -Destination "http://contosoaccount.blob.core.windows ... eimage.vhd" -LocalFilePath "C:\\vhd\\Win7Image.vhd"
-Overwrite
This command adds a .vhd file to a storage account. The command overwrites an existing file.
Example 3: Add a VHD file and specify the number of threads
PS C:\\> Add-AzureRmVhd -Destination "http://contosoaccount.blob.core.windows ... eimage.vhd" -LocalFilePath "C:\\vhd\\Win7Image.vhd"
-NumberOfUploaderThreads 32
This command adds a .vhd file to a storage account. The command specifies the number of threads to use to upload the file.
Example 4: Add a VHD file and specify the SAS URI
PS C:\\> Add-AzureRmVhd -Destination "http://contosoaccount.blob.core.windows ... st=2013-01
-09T22%3A15%3A49Z&se=2013-01-09T23%3A10%3A49Z&sr=b&sp=w&sig=13T9Ow%2FRJAMmhfO%2FaP3HhKKJ6AY093SmveO SIV4%2FR7w%3D" -LocalFilePath
"C:\\vhd\\win7baseimage.vhd"
This command adds a .vhd file to a storage account and specifies the SAS URI.
RELATED LINKS
Online Version: https://docs.microsoft.com/en-us/powers ... azurermvhd
Save-AzureRmVhd
SYNOPSIS
Uploads a virtual hard disk from an on-premises virtual machine to a blob in a cloud storage account in Azure.
SYNTAX
Add-AzureRmVhd [[-ResourceGroupName] <String>] [-Destination] <Uri> [-LocalFilePath] <FileInfo> [[-NumberOfUploaderThreads] <Int32>]
[[-BaseImageUriToPatch] <Uri>] [[-OverWrite]] [-AsJob] [-DefaultProfile <IAzureContextContainer>] [<CommonParameters>]
DESCRIPTION
The Add-AzureRmVhd cmdlet uploads on-premises virtual hard disks, in .vhd file format, to a blob storage account as fixed virtual hard disks. You
can configure the number of uploader threads that will be used or overwrite an existing blob in the specified destination URI. Also supported is
the ability to upload a patched version of an on-premises .vhd file. When a base virtual hard disk has already been uploaded, you can upload
differencing disks that use the base image as the parent. Shared access signature (SAS) URI is supported also.
PARAMETERS
-AsJob [<SwitchParameter>]
Run cmdlet in the background and return a Job to track progress.
Required? false
Position? named
Default value False
Accept pipeline input? False
Accept wildcard characters? false
-BaseImageUriToPatch <Uri>
Specifies the URI to a base image blob in Azure Blob Storage. An SAS can be specified as the value for this parameter.
Required? false
Position? 4
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-DefaultProfile <IAzureContextContainer>
The credentials, account, tenant, and subscription used for communication with azure.
Required? false
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-Destination <Uri>
Specifies the URI of a blob in Blob Storage. The parameter supports SAS URI, although patching scenarios destination cannot be an SAS URI.
Required? true
Position? 1
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-LocalFilePath <FileInfo>
Specifies the path of the local .vhd file.
Required? true
Position? 2
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-NumberOfUploaderThreads <Int32>
Specifies the number of uploader threads to be used when uploading the .vhd file.
Required? false
Position? 3
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-OverWrite [<SwitchParameter>]
Indicates that this cmdlet overwrites an existing blob in the specified destination URI, if one exists.
Required? false
Position? 5
Default value False
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-ResourceGroupName <String>
Specifies the name of the resource group of the virtual machine.
Required? false
Position? 0
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
None
This cmdlet does not accept any input.
OUTPUTS
Microsoft.Azure.Commands.Compute.Models.VhdUploadContext
NOTES
Example 1: Add a VHD file
PS C:\\> Add-AzureRmVhd -Destination "http://contosoaccount.blob.core.windows ... eimage.vhd" -LocalFilePath "C:\\vhd\\Win7Image.vhd"
This command adds a .vhd file to a storage account.
Example 2: Add a VHD file and overwrite the destination
PS C:\\> Add-AzureRmVhd -Destination "http://contosoaccount.blob.core.windows ... eimage.vhd" -LocalFilePath "C:\\vhd\\Win7Image.vhd"
-Overwrite
This command adds a .vhd file to a storage account. The command overwrites an existing file.
Example 3: Add a VHD file and specify the number of threads
PS C:\\> Add-AzureRmVhd -Destination "http://contosoaccount.blob.core.windows ... eimage.vhd" -LocalFilePath "C:\\vhd\\Win7Image.vhd"
-NumberOfUploaderThreads 32
This command adds a .vhd file to a storage account. The command specifies the number of threads to use to upload the file.
Example 4: Add a VHD file and specify the SAS URI
PS C:\\> Add-AzureRmVhd -Destination "http://contosoaccount.blob.core.windows ... st=2013-01
-09T22%3A15%3A49Z&se=2013-01-09T23%3A10%3A49Z&sr=b&sp=w&sig=13T9Ow%2FRJAMmhfO%2FaP3HhKKJ6AY093SmveO SIV4%2FR7w%3D" -LocalFilePath
"C:\\vhd\\win7baseimage.vhd"
This command adds a .vhd file to a storage account and specifies the SAS URI.
RELATED LINKS
Online Version: https://docs.microsoft.com/en-us/powers ... azurermvhd
Save-AzureRmVhd