Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/Compute/Compute.Test/Compute.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.Azure.Graph.RBAC" Version="3.4.0-preview" />
<PackageReference Include="Microsoft.Azure.Management.Compute" Version="35.1.0" />
<PackageReference Include="Microsoft.Azure.Management.Compute" Version="36.0.0" />
<PackageReference Include="Microsoft.Azure.Management.KeyVault" Version="3.0.0" />
<PackageReference Include="Microsoft.Azure.Management.Network" Version="19.20.0-preview" />
</ItemGroup>
Expand All @@ -32,4 +32,3 @@
</ItemGroup>

</Project>

17 changes: 15 additions & 2 deletions src/Compute/Compute.Test/ScenarioTests/DedicatedHostTests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -192,19 +192,32 @@ function Test-DedicatedHostVirtualMachine

# Remove Host from VM
Stop-AzVM -ResourceGroupName $rgname -Name $vmName1 -Force;
$vm1.Host.Id = $null;
Update-AzVM -ResourceGroupName $rgname -VM $vm1;
$vm1 = Get-AzVM -ResourceGroupName $rgname -Name $vmName1;
Update-AzVM -ResourceGroupName $rgname -VM $vm1 -HostId $null;

$vm1 = Get-AzVM -ResourceGroupName $rgname -Name $vmname1;
Assert-Null $vm1.Host;
$dedicatedHost = Get-AzHost -ResourceGroupName $rgname -HostGroupName $hostGroupName -Name $hostName;
Assert-AreEqual 1 $dedicatedHost.VirtualMachines.Count;
Assert-AreEqual $vm0.Id $dedicatedHost.VirtualMachines[0].Id;
$dedicatedHostGroup = Get-AzHostGroup -ResourceGroupName $rgname -HostGroupName $hostGroupNam;
Assert-AreEqual 1 $dedicatedHostGroup.Hosts.Count;
Assert-AreEqual $dedicatedHostId $dedicatedHostGroup.Hosts[0].Id;

# Add Host back to the VM
Update-AzVM -ResourceGroupName $rgname -VM $vm1 -HostId $dedicatedHostId;

$vm1 = Get-AzVM -ResourceGroupName $rgname -Name $vmname1;
Assert-AreEqual $dedicatedHostId $vm1.Host.Id;
$dedicatedHost = Get-AzHost -ResourceGroupName $rgname -HostGroupName $hostGroupName -Name $hostName;
Assert-AreEqual 2 $dedicatedHost.VirtualMachines.Count;
Assert-AreEqual $vm0.Id $dedicatedHost.VirtualMachines[0].Id;
Assert-AreEqual $vm1.Id $dedicatedHost.VirtualMachines[1].Id;
$dedicatedHostGroup = Get-AzHostGroup -ResourceGroupName $rgname -HostGroupName $hostGroupNam;
Assert-AreEqual 1 $dedicatedHostGroup.Hosts.Count;
Assert-AreEqual $dedicatedHostId $dedicatedHostGroup.Hosts[0].Id;

# Remove the VMs
Remove-AzVM -ResourceGroupName $rgname -Name $vmname1 -Force;

$dedicatedHost = Get-AzHost -ResourceGroupName $rgname -HostGroupName $hostGroupName -Name $hostName;
Expand Down

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions src/Compute/Compute/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
- Additional information about change #1
-->
## Upcoming Release
* Add HostId parameter to Update-AzVM cmdlet
* Update Help documents for New-AzVMConfig, New-AzVmssConfig, Update-AzVmss, Set-AzVMOperatingSystem and Set-AzVmssOsProfile cmdlets.
* Breaking changes
- FilterExpression parameter is removed from Get-AzVMImage cmdlet.
- AssignIdentity parameter is removed from New-AzVmssConfig, New-AzVMConfig and Update-AzVM cmdlets.
Expand Down
2 changes: 1 addition & 1 deletion src/Compute/Compute/Compute.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

<ItemGroup>
<PackageReference Include="AutoMapper" Version="6.2.2" />
<PackageReference Include="Microsoft.Azure.Management.Compute" Version="35.1.0" />
<PackageReference Include="Microsoft.Azure.Management.Compute" Version="36.0.0" />
<PackageReference Include="System.Security.Permissions" Version="4.5.0" />
<PackageReference Include="System.ServiceModel.Primitives" Version="4.4.1" />
<PackageReference Include="WindowsAzure.Storage" Version="9.3.0" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,11 @@ public class UpdateAzureVMCommand : VirtualMachineBaseCmdlet
[AllowEmptyString]
public string ProximityPlacementGroupId { get; set; }

[Parameter(
ValueFromPipelineByPropertyName = true,
HelpMessage = "The Id of Host")]
public string HostId { get; set; }

[Parameter(Mandatory = false, HelpMessage = "Run cmdlet in the background")]
public SwitchParameter AsJob { get; set; }

Expand Down Expand Up @@ -135,7 +140,9 @@ public override void ExecuteCmdlet()
ProximityPlacementGroup = this.IsParameterBound(c => c.ProximityPlacementGroupId)
? new SubResource(this.ProximityPlacementGroupId)
: this.VM.ProximityPlacementGroup,
Host = this.VM.Host,
Host = this.IsParameterBound(c => c.HostId)
? new SubResource(this.HostId)
: this.VM.Host,
VirtualMachineScaleSet = this.VM.VirtualMachineScaleSet,
AdditionalCapabilities = this.VM.AdditionalCapabilities,
EvictionPolicy = this.VM.EvictionPolicy,
Expand Down
7 changes: 6 additions & 1 deletion src/Compute/Compute/help/New-AzVMConfig.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,12 @@ The virtual machine belongs to the availability set stored in $AvailabilitySet.
### -AvailabilitySetId
Specifies the ID of an availability set.
To obtain an availability set object, use the Get-AzAvailabilitySet cmdlet.
The availability set object contains an ID property.
The availability set object contains an ID property. <br>
Virtual machines specified in the same availability set are allocated to different nodes to maximize availability. <br>
For more information about availability sets, see [Manage the availability of virtual machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). <br>
For more information on Azure planned maintenance, see [Planned maintenance for virtual machines in Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) <br>
Currently, a VM can only be added to availability set at creation time. The availability set to which the VM is being added should be under the same resource group as the availability set resource. An existing VM cannot be added to an availability set. <br>
This property cannot exist along with a non-null properties.virtualMachineScaleSet reference.

```yaml
Type: System.String
Expand Down
2 changes: 1 addition & 1 deletion src/Compute/Compute/help/New-AzVmssConfig.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ uses the VMSS configuration object created in the first command.
## PARAMETERS

### -AutomaticRepairGracePeriod
The amount of time for which automatic repairs are suspended due to a state change on VM. The grace time starts after the state change has completed. This helps avoid premature or accidental repairs. The time duration should be specified in ISO 8601 format. The default value is 5 minutes (PT5M).
The amount of time for which automatic repairs are suspended due to a state change on VM. The grace time starts after the state change has completed. This helps avoid premature or accidental repairs. The time duration should be specified in ISO 8601 format. The minimum allowed grace period is 30 minutes (PT30M), which is also the default value. The maximum allowed grace period is 90 minutes (PT90M).

```yaml
Type: System.String
Expand Down
9 changes: 7 additions & 2 deletions src/Compute/Compute/help/Set-AzVMOperatingSystem.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,11 @@ Accept wildcard characters: False
### -CustomData
Specifies a base-64 encoded string of custom data.
This is decoded to a binary array that is saved as a file on the virtual machine.
The maximum length of the binary array is 65535 bytes.
The maximum length of the binary array is 65535 bytes.<br>
**Note: Do not pass any secrets or passwords in customData property**<br>
This property cannot be updated after the VM is created. <br>
customData is passed to the VM to be saved as a file, for more information see [Custom Data on Azure VMs](https://azure.microsoft.com/en-us/blog/custom-data-and-cloud-init-on-windows-azure/) <br>
For using cloud-init for your Linux VM, see [Using cloud-init to customize a Linux VM during creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init)

```yaml
Type: System.String
Expand Down Expand Up @@ -226,7 +230,8 @@ Accept wildcard characters: False
```

### -TimeZone
Specifies the time zone for the virtual machine.
Specifies the time zone of the virtual machine. e.g. \"Pacific Standard Time\". <br>
Possible values can be [TimeZoneInfo.Id](https://docs.microsoft.com/en-us/dotnet/api/system.timezoneinfo.id?#System_TimeZoneInfo_Id) value from time zones returned by [TimeZoneInfo.GetSystemTimeZones](https://docs.microsoft.com/en-us/dotnet/api/system.timezoneinfo.getsystemtimezones).

```yaml
Type: System.String
Expand Down
15 changes: 12 additions & 3 deletions src/Compute/Compute/help/Set-AzVmssOsProfile.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,14 @@ Accept wildcard characters: False
```

### -AdminUsername
Specifies the administrator account name to use for all the virtual machine instances in the VMSS.
Specifies the administrator account name to use for all the virtual machine instances in the VMSS. <br>
**Windows-only restriction:** Cannot end in \".\" <br>
**Disallowed values:** \"administrator\", \"admin\", \"user\", \"user1\", \"test\", \"user2\", \"test1\", \"user3\", \"admin1\", \"1\", \"123\", \"a\", \"actuser\", \"adm\", \"admin2\", \"aspnet\", \"backup\", \"console\", \"david\", \"guest\", \"john\", \"owner\", \"root\", \"server\", \"sql\", \"support\", \"support_388945a0\", \"sys\", \"test2\", \"test3\", \"user4\", \"user5\". <br>
**Minimum-length (Linux):** 1 character <br>
**Max-length (Linux):** 64 characters <br>
**Max-length (Windows):** 20 characters <br>
<li> For root access to the Linux VM, see [Using root privileges on Linux virtual machines in Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json).<br>
<li> For a list of built-in system users on Linux that should not be used in this field, see [Selecting User Names for Linux on Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json).

```yaml
Type: System.String
Expand Down Expand Up @@ -103,7 +110,8 @@ Accept wildcard characters: False
### -CustomData
Specifies a base-64 encoded string of custom data.
This is decoded to a binary array that is saved as a file on the virtual machine.
The maximum length of the binary array is 65535 bytes.
The maximum length of the binary array is 65535 bytes. <br>
For using cloud-init for your VM, see [Using cloud-init to customize a Linux VM during creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json).

```yaml
Type: System.String
Expand Down Expand Up @@ -197,7 +205,8 @@ Accept wildcard characters: False
```

### -TimeZone
Specifies the time zone for the virtual machine.
Specifies the time zone of the virtual machine. e.g. \"Pacific Standard Time\". <br>
Possible values can be [TimeZoneInfo.Id](https://docs.microsoft.com/en-us/dotnet/api/system.timezoneinfo.id?#System_TimeZoneInfo_Id) value from time zones returned by [TimeZoneInfo.GetSystemTimeZones](https://docs.microsoft.com/en-us/dotnet/api/system.timezoneinfo.getsystemtimezones).

```yaml
Type: System.String
Expand Down
27 changes: 21 additions & 6 deletions src/Compute/Compute/help/Update-AzVM.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,23 @@ Updates the state of an Azure virtual machine.
```
Update-AzVM [-ResourceGroupName] <String> -VM <PSVirtualMachine> [-Tag <Hashtable>]
[-OsDiskWriteAccelerator <Boolean>] [-UltraSSDEnabled <Boolean>] [-MaxPrice <Double>]
[-ProximityPlacementGroupId <String>] [-AsJob] [-NoWait] [-DefaultProfile <IAzureContextContainer>] [-WhatIf]
[-Confirm] [<CommonParameters>]
[-ProximityPlacementGroupId <String>] [-HostId <String>] [-AsJob] [-NoWait]
[-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
```

### ExplicitIdentityParameterSet
```
Update-AzVM [-ResourceGroupName] <String> -VM <PSVirtualMachine> [-Tag <Hashtable>]
-IdentityType <ResourceIdentityType> [-IdentityId <String[]>] [-OsDiskWriteAccelerator <Boolean>]
[-UltraSSDEnabled <Boolean>] [-MaxPrice <Double>] [-ProximityPlacementGroupId <String>] [-AsJob] [-NoWait]
[-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
[-UltraSSDEnabled <Boolean>] [-MaxPrice <Double>] [-ProximityPlacementGroupId <String>] [-HostId <String>]
[-AsJob] [-NoWait] [-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
```

### IdParameterSetName
```
Update-AzVM [-Id] <String> -VM <PSVirtualMachine> [-Tag <Hashtable>] [-OsDiskWriteAccelerator <Boolean>]
[-UltraSSDEnabled <Boolean>] [-MaxPrice <Double>] [-ProximityPlacementGroupId <String>] [-AsJob] [-NoWait]
[-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
[-UltraSSDEnabled <Boolean>] [-MaxPrice <Double>] [-ProximityPlacementGroupId <String>] [-HostId <String>]
[-AsJob] [-NoWait] [-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
```

## DESCRIPTION
Expand Down Expand Up @@ -82,6 +82,21 @@ Accept pipeline input: False
Accept wildcard characters: False
```

### -HostId
The Id of Host

```yaml
Type: System.String
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
```

### -Id
Specifies the resource ID of the virtual machine.

Expand Down
8 changes: 5 additions & 3 deletions src/Compute/Compute/help/Update-AzVmss.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ Accept wildcard characters: False
```

### -AutomaticRepairGracePeriod
The amount of time for which automatic repairs are suspended due to a state change on VM. The grace time starts after the state change has completed. This helps avoid premature or accidental repairs. The time duration should be specified in ISO 8601 format. The default value is 5 minutes (PT5M).
The amount of time for which automatic repairs are suspended due to a state change on VM. The grace time starts after the state change has completed. This helps avoid premature or accidental repairs. The time duration should be specified in ISO 8601 format. The minimum allowed grace period is 30 minutes (PT30M), which is also the default value. The maximum allowed grace period is 90 minutes (PT90M).

```yaml
Type: System.String
Expand Down Expand Up @@ -151,7 +151,8 @@ Accept wildcard characters: False
### -CustomData
Specifies a base-64 encoded string of custom data.
This is decoded to a binary array that is saved as a file on the virtual machine.
The maximum length of the binary array is 65535 bytes.
The maximum length of the binary array is 65535 bytes. <br>
For using cloud-init for your VM, see [Using cloud-init to customize a Linux VM during creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json).

```yaml
Type: System.String
Expand Down Expand Up @@ -789,7 +790,8 @@ Accept wildcard characters: False
```

### -TimeZone
Specifies the time zone for Windows OS.
Specifies the time zone for Windows OS. e.g. \"Pacific Standard Time\". <br>
Possible values can be [TimeZoneInfo.Id](https://docs.microsoft.com/en-us/dotnet/api/system.timezoneinfo.id?#System_TimeZoneInfo_Id) value from time zones returned by [TimeZoneInfo.GetSystemTimeZones](https://docs.microsoft.com/en-us/dotnet/api/system.timezoneinfo.getsystemtimezones).

```yaml
Type: System.String
Expand Down
4 changes: 1 addition & 3 deletions src/Network/Network.Test/Network.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<PackageReference Include="Microsoft.Azure.Graph.RBAC" Version="3.4.0-preview" />
<PackageReference Include="Microsoft.Azure.Management.Network" Version="19.20.0-preview" />
<PackageReference Include="Microsoft.Azure.Insights" Version="0.16.0-preview" />
<PackageReference Include="Microsoft.Azure.Management.Compute" Version="35.1.0" />
<PackageReference Include="Microsoft.Azure.Management.Compute" Version="36.0.0" />
<PackageReference Include="Microsoft.Azure.Management.ContainerInstance" Version="2.0.0" />
<PackageReference Include="Microsoft.Azure.Management.Redis" Version="4.4.1" />
<PackageReference Include="Microsoft.Azure.Management.OperationalInsights" Version="0.19.0-preview" />
Expand All @@ -36,5 +36,3 @@
</ItemGroup>

</Project>


Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Azure.Management.Compute" Version="35.1.0" />
<PackageReference Include="Microsoft.Azure.Management.Compute" Version="36.0.0" />
<PackageReference Include="Microsoft.Azure.Management.Network" Version="19.20.0-preview" />
<PackageReference Include="Microsoft.Azure.Management.RecoveryServices" Version="4.2.1-preview" />
<PackageReference Include="Microsoft.Azure.Management.RecoveryServices.Backup" Version="4.0.1-preview" />
Expand All @@ -26,4 +26,3 @@
</ItemGroup>

</Project>

Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Azure.Management.Compute" Version="35.1.0" />
<PackageReference Include="Microsoft.Azure.Management.Compute" Version="36.0.0" />
<PackageReference Include="Microsoft.Azure.Management.Network" Version="19.20.0-preview" />
<PackageReference Include="Microsoft.Azure.Management.RecoveryServices" Version="4.2.1-preview" />
<PackageReference Include="Microsoft.Azure.Management.Storage" Version="14.3.0" />
Expand All @@ -29,4 +29,3 @@
</ItemGroup>

</Project>

Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,10 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Azure.Management.Compute" Version="35.1.0" />
<PackageReference Include="Microsoft.Azure.Management.Compute" Version="36.0.0" />
<PackageReference Include="Microsoft.Azure.Management.Network" Version="19.20.0-preview" />
<PackageReference Include="Microsoft.Azure.Management.Storage" Version="13.1.0" />
<PackageReference Include="Microsoft.Azure.Management.ResourceManager" Version="3.0.0-preview" />
</ItemGroup>

</Project>