Cmdlets

Choose a cmdlet from the list on the left or search for a specific cmdlet. Choose a cmdlet from the list or search for a specific cmdlet.
About Help  Providers
 

Set-AzureVMOSDisk

Set-AzureVMOSDisk

microsoft.azure.commands.compute.dll

Synopsis

Set the OS Disk properties on the VM

Syntax

Set-AzureVMOSDisk [-VM] [-Name] [-VhdUri] [-Caching] [-SourceImageUri] [-CreateOption] [-Windows] [-Profile] [-InformationAction] [-InformationVariable] [<CommonParameters>]

Set-AzureVMOSDisk [-VM] [-Name] [-VhdUri] [-Caching] [-SourceImageUri] [-CreateOption] [-Linux] [-Profile] [-InformationAction] [-InformationVariable] [<CommonParameters>]

Detailed Description

Set the OS Disk properties on the VM

Parameters

-VM <PSVirtualMachine>

The local VM object to set the OS Disk properties on

Aliases

None

Required?

true

Position

0

Default value

None

Accept pipeline input?

true (ByValue, ByPropertyName)

Accept wildcard characters?

false

-Name <String>

Name of the OS Disk

Aliases

None

Required?

true

Position

1

Default value

None

Accept pipeline input?

true (ByPropertyName)

Accept wildcard characters?

false

-VhdUri <String>

For Image based VM Creation – Specifies the VHD file that needs to be created when a platform image or user image is specified. This is where the image blob will be copied to start the VM from. Example: http://contoso.blob.core.windows.net/System/ComputeVM/myImage/mydisk.vhd For Disk based VM Boot scenario – Specifies the VHD file that needs to be used directly (without copy) for booting up the VM. Applies to both OS and Data Disks.

Aliases

None

Required?

false

Position

2

Default value

None

Accept pipeline input?

true (ByPropertyName)

Accept wildcard characters?

false

-Caching <String>

Specifies the caching mode of the operating system disk. This setting impacts the consistency and performance of the disk. Note: Changing this value causes the Virtual Machine to reboot. Possible values are: The default value is ReadWrite. • ReadOnly • ReadWrite

Aliases

None

Required?

false

Position

3

Default value

None

Accept pipeline input?

true (ByPropertyName)

Accept wildcard characters?

false

-SourceImageUri <String>

Uri of the existing VHD in case attaching the disk to the VM

Aliases

None

Required?

false

Position

4

Default value

None

Accept pipeline input?

true (ByPropertyName)

Accept wildcard characters?

false

-CreateOption <String>

Specifies whether to create a disk in the VM from a platform or user image, to create a new empty disk or to attach an existing disk. Valid values are

"FromImage”, “Attach” or “Empty”

Aliases

None

Required?

true

Position

5

Default value

None

Accept pipeline input?

true (ByPropertyName)

Accept wildcard characters?

false

-Windows <SwitchParameter>

Used in case of a user image based VM deployment to specify that the OS on the user image is Windows.

Aliases

None

Required?

false

Position

6

Default value

None

Accept pipeline input?

true (ByPropertyName)

Accept wildcard characters?

false

-Profile <AzureProfile>

Aliases

None

Required?

false

Position

named

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-InformationAction <ActionPreference>

Aliases

None

Required?

false

Position

named

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-InformationVariable <String>

Aliases

None

Required?

false

Position

named

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-Linux <SwitchParameter>

Used in case of a user image based VM deployment to specify that the OS on the user image is Linux.

Aliases

None

Required?

false

Position

6

Default value

None

Accept pipeline input?

true (ByPropertyName)

Accept wildcard characters?

false

Input Type


Return Type


Notes

Examples

-------------------------- Example 1 --------------------------

$stoname = 'teststo';

$osDiskName = 'osDisk';
$osDiskCaching = 'ReadWrite';
$osDiskVhdUri = "https://$stoname.blob.core.windows.net/test/os.vhd";

$vm = Set-AzureVMOSDisk -VM $vm -Name $osDiskName -VhdUri $osDiskVhdUri -Caching $osDiskCaching -CreateOption Empty;