New-AzHostGroup

Creates a host group.

Note

This is the previous version of our documentation. Please consult the most recent version for up-to-date information.

Syntax

New-AzHostGroup
   [-ResourceGroupName] <String>
   [-Name] <String>
   [-Location] <String>
   -PlatformFaultDomain <Int32>
   [-Zone <String[]>]
   [-SupportAutomaticPlacement <bool>]
   [-Tag <Hashtable>]
   [-AsJob]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

This cmdlet will create a Host group.

Examples

Example 1

New-AzHostGroup -ResourceGroupName $resourceGroupName -Name $hostGroupName -Location $location -Zone $zone

ResourceGroupName        : myrg01
PlatformFaultDomainCount : 2
Hosts                    : {/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myrg01/providers/Microsoft.Compute/hostGroups/myhostgroup01/hosts/myhost01}
Zones                    : {1}
Id                       : /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myrg01/providers/Microsoft.Compute/hostGroups/myhostgroup01
Name                     : myhostgroup01
Location                 : eastus
Tags                     : {[key1, val1]}

This command creates a host group in the given location and zone.

Parameters

-AsJob

Run cmdlet in the background

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-DefaultProfile

The credentials, account, tenant, and subscription used for communication with Azure.

Type:IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Location

Specifies location.

Type:String
Position:2
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Name

Specifies the name of the host group.

Type:String
Aliases:HostGroupName
Position:1
Default value:None
Accept pipeline input:True
Accept wildcard characters:False
-PlatformFaultDomain

Specifies the number of fault domains that the host group can span. The minimum value is 1 and the maximum value is 3.

Type:Int32
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ResourceGroupName

The name of the resource group.

Type:String
Position:0
Default value:None
Accept pipeline input:True
Accept wildcard characters:False
-SupportAutomaticPlacement

Specifies if HostGroup will enable automatic placement of vm's. Automatic placement means these VMs are placed on dedicated hosts, chosen by Azure, under the dedicated host group. If not specified, default value will be false.

Type:bool
Position:Named
Default value:True
Accept pipeline input:False
Accept wildcard characters:False
-Tag

Specifies Tags

Type:Hashtable
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Zone

Specifies Zones of the host group.

Type:String[]
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

Inputs

String

Outputs

PSHostGroup