Restart-AzHost
Start de toegewezen host opnieuw op.
Syntaxis
Restart-AzHost
[-ResourceGroupName] <String>
[-HostGroupName] <String>
[-Name] <String>
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Restart-AzHost
-ResourceId <String>
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Restart-AzHost
-InputObject <PSHost>
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
Start de toegewezen host opnieuw op. De bewerking wordt voltooid zodra de toegewezen host opnieuw is opgestart en wordt uitgevoerd. Controleer het Resource Health Center in de Azure-portal om de status te bepalen van vm's die op de toegewezen host zijn geïmplementeerd. Raadpleeg https://learn.microsoft.com/en-us/azure/service-health/resource-health-overview voor meer informatie.
Voorbeelden
Voorbeeld 1
$Location = 'Location';
$ResourceGroupName = New-AzResourceGroup -Name $rgname -Location $Location -Force;
$hostGroupName = $ResourceGroupName + 'hostgroup'
New-AzHostGroup -ResourceGroupName $ResourceGroupName -Name $hostGroupName -Location $Location -PlatformFaultDomain 1 -Zone "2" -Tag @{key1 = "val1"};
$hostGroup = Get-AzHostGroup -ResourceGroupName $ResourceGroupName -Name $hostGroupName;
$hostName = $ResourceGroupName + 'host';
New-AzHost -ResourceGroupName $ResourceGroupName -HostGroupName $hostGroupName -Name $hostName -Location $Location -Sku "ESv3-Type1" -Tag @{key1 = "val2"};
$dedicatedHost = Get-AzHost -ResourceGroupName $ResourceGroupName -HostGroupName $hostGroupName -Name $hostName;
Restart-AzHost -ResourceGroupName $ResourceGroupName -HostGroupName $hostGroupName -Name $hostName;
# Check the status of the restart operation
$hostRestart = Get-AzHost -ResourceGroupName $rgname -HostGroupName $hostGroupName -Name $hostName -InstanceView;
$hostRestart.InstanceView.Statuses[1].DisplayStatus;
In dit voorbeeld wordt een toegewezen hostgroep en een toegewezen host gemaakt. Vervolgens wordt de toegewezen host opnieuw opgestart en wordt de status van deze herstartbewerking gecontroleerd.
U kunt een query uitvoeren op de status van de herstartbewerking met de cmdlet Get-AzHost
met behulp van de parameter -InstanceView
.
Parameters
-Confirm
U wordt gevraagd om bevestiging voordat u de cmdlet uitvoert.
Type: | SwitchParameter |
Aliassen: | cf |
Position: | Named |
Default value: | None |
Vereist: | False |
Pijplijninvoer accepteren: | False |
Jokertekens accepteren: | False |
-DefaultProfile
De referenties, accounts, tenants en abonnementen die worden gebruikt voor communicatie met Azure.
Type: | IAzureContextContainer |
Aliassen: | AzContext, AzureRmContext, AzureCredential |
Position: | Named |
Default value: | None |
Vereist: | False |
Pijplijninvoer accepteren: | False |
Jokertekens accepteren: | False |
-HostGroupName
De naam van de toegewezen hostgroep.
Type: | String |
Position: | 1 |
Default value: | None |
Vereist: | True |
Pijplijninvoer accepteren: | True |
Jokertekens accepteren: | False |
-InputObject
Het toegewezen hostobject.
Type: | PSHost |
Aliassen: | Host |
Position: | Named |
Default value: | None |
Vereist: | True |
Pijplijninvoer accepteren: | True |
Jokertekens accepteren: | False |
-Name
De naam van de toegewezen host.
Type: | String |
Aliassen: | HostName |
Position: | 2 |
Default value: | None |
Vereist: | True |
Pijplijninvoer accepteren: | True |
Jokertekens accepteren: | False |
-ResourceGroupName
De naam van de resourcegroep.
Type: | String |
Position: | 0 |
Default value: | None |
Vereist: | True |
Pijplijninvoer accepteren: | True |
Jokertekens accepteren: | False |
-ResourceId
De ARM-resource-id van de toegewezen host.
Type: | String |
Position: | Named |
Default value: | None |
Vereist: | True |
Pijplijninvoer accepteren: | True |
Jokertekens accepteren: | False |
-WhatIf
Toont wat er zou gebeuren als de cmdlet wordt uitgevoerd. De cmdlet wordt niet uitgevoerd.
Type: | SwitchParameter |
Aliassen: | wi |
Position: | Named |
Default value: | None |
Vereist: | False |
Pijplijninvoer accepteren: | False |
Jokertekens accepteren: | False |
Invoerwaarden
Uitvoerwaarden
Azure PowerShell