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-AzureOSDisk

Set-AzureOSDisk

microsoft.windowsazure.commands.servicemanagement.dll

Synopsis

Updates the host-cache mode of a Microsoft Azure virtual machine operating system disk.

Syntax

Set-AzureOSDisk [-HostCaching] [-VM] [<CommonParameters>]

Detailed Description

The Set-AzureOSDisk cmdlet updates the host-cache mode of a virtual machine's operating system disk. The supported host cache modes are "ReadOnly" and "ReadWrite".Caution: Running Set-AzureOSDisk on a running virtual machine will cause the virtual machine to reboot.

Parameters

-HostCaching <String>

Specifies the host cache attribute for the operating system disk. Acceptable values are: "ReadOnly" and "ReadWrite".

Aliases

None

Required?

true

Position

0

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-VM <IPersistentVM>

Specifies the virtual machine for which to update the operating system disk.

Aliases

None

Required?

true

Position

named

Default value

None

Accept pipeline input?

true (ByValue, ByPropertyName)

Accept wildcard characters?

false

Input Type


Return Type


Notes

Examples

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

This command sets the host cache mode of the operating system disk of the VM named "MyTestVM2" to ReadOnly.

PS C:\> C:\PS>Get-AzureVM -ServiceName $mySvc1 -name "MyTestVM2" | Set-AzureOSDisk –HostCaching "ReadOnly"

-------------------------- Example 2 --------------------------

This command updates the host-cache mode of the operating system disk attached to the VM named "MyTestVM2" to ReadWrite.

PS C:\> C:\PS>$myVM2 = Get-AzureVM -ServiceName $mySvc1 -name "MyTestVM2"
          C:\PS>Set-AzureOSDisk "ReadWrite" –VM $myVM2

Get-AzureOSDisk
Add-AzureVMImage
Get-AzureVMImage
Get-AzureVM
Update-AzureVM