Join-SCVirtualMachine

Aggiornamento: luglio 2015

Join-SCVirtualMachine

Re-associates an orphaned virtual machine to its service or virtual machine role.

Sintassi

Parameter Set: ServiceComputerTierParameterSet
Join-SCVirtualMachine [-VM] <VM> -ComputerTier <ComputerTier> [-JobVariable <String> ] [-OnBehalfOfUser <String> ] [-OnBehalfOfUserRole <UserRole> ] [-PROTipID <Guid> ] [-RunAsynchronously] [ <CommonParameters>]

Parameter Set: VMRoleParameterSet
Join-SCVirtualMachine [-VM] <VM> -VMRole <CloudVmRole> [-JobVariable <String> ] [-OnBehalfOfUser <String> ] [-OnBehalfOfUserRole <UserRole> ] [-PROTipID <Guid> ] [-RunAsynchronously] [ <CommonParameters>]

Descrizione dettagliata

The Join-SCVirtualMachine cmdlet re-associates an orphaned virtual machine to its service or virtual machine role.

When a host or cluster is removed from Virtual Machine Manager (VMM), any virtual machines belonging to a service or a virtual machine role deployed on the host remain functional. However, on adding the host or cluster back to VMM, the virtual machines become orphaned in the sense that they no longer have any association with their service or virtual machine role.

You can use this cmdlet to restore the association between a virtual machine and its service or virtual machine role. The Join-SCVirtualMachine cmdlet runs a re-associate task on VMM that performs a set of validations that help confirm the compatibility of the virtual machine with the service template.

When the cmdlet validates the compatibility of the virtual machine with the computer tier template, database-only operations are performed, and no adjustments are made to the virtual machine. It is assumed that the virtual machine is running and that all of the guest applications and services running on it are intact.

The computer tier to which you want to join the virtual machine must be running below its maximum instance count. The upgrade domain for the join operation is similar to a scale-out.

For best results, use this cmdlet with a virtual machine that was originally part of a service or virtual machine role deployment and was not modified.

Parametri

-ComputerTier<ComputerTier>

Specifies the computer tier of a service instance to which to join a virtual machine.

Alias

none

Obbligatorio?

true

Posizione?

named

Valore predefinito

none

Accetta input da pipeline?

false

Accetta caratteri jolly?

false

-JobVariable<String>

Specifies a variable in which job progress is tracked and stored.

Alias

none

Obbligatorio?

false

Posizione?

named

Valore predefinito

none

Accetta input da pipeline?

false

Accetta caratteri jolly?

false

-OnBehalfOfUser<String>

Specifies a user name. This cmdlet operates on behalf of the user that this parameter specifies.

Alias

none

Obbligatorio?

false

Posizione?

named

Valore predefinito

none

Accetta input da pipeline?

false

Accetta caratteri jolly?

false

-OnBehalfOfUserRole<UserRole>

Specifies a user role. To obtain a user role, use the Get-SCUserRole cmdlet. This cmdlet operates on behalf of the user role that this parameter specifies.

Alias

none

Obbligatorio?

false

Posizione?

named

Valore predefinito

none

Accetta input da pipeline?

false

Accetta caratteri jolly?

false

-PROTipID<Guid>

Specifies the ID of the Performance and Resource Optimization tip (PRO tip) that triggered this action. This parameter lets you audit PRO tips.

Alias

none

Obbligatorio?

false

Posizione?

named

Valore predefinito

none

Accetta input da pipeline?

false

Accetta caratteri jolly?

false

-RunAsynchronously

Indicates that the job runs asynchronously so that control returns to the command shell immediately.

Alias

none

Obbligatorio?

false

Posizione?

named

Valore predefinito

none

Accetta input da pipeline?

false

Accetta caratteri jolly?

false

-VM<VM>

Specifies the virtual machine to join.

Alias

none

Obbligatorio?

true

Posizione?

1

Valore predefinito

none

Accetta input da pipeline?

true(ByValue)

Accetta caratteri jolly?

false

-VMRole<CloudVmRole>

Specifies a virtual machine role object to join.

Alias

none

Obbligatorio?

true

Posizione?

named

Valore predefinito

none

Accetta input da pipeline?

false

Accetta caratteri jolly?

false

<CommonParameters>

Questo cmdlet supporta i parametri comuni: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer e -OutVariable. Per altre informazioni, vedere   about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).

Input

Il tipo di input è il tipo degli oggetti che è possibile reindirizzare al cmdlet.

Output

Il tipo di output corrisponde al tipo di oggetti generati dal cmdlet.

Note

  • Joining a virtual machine to a service or virtual machine role that uses load balancers is not supported. If you attempt to join a virtual machine to a service or virtual machine role that uses load balancers, then you must configure any load balancer settings manually.

Esempi

Example 1: Join an orphaned virtual machine to a service tier

The first command gets the virtual machine named PS-Web-001, and then stores it in the $VM variable.

The second command gets the computer tier named MyService-WebTier, and then stores it in the $CT variable.

The last command joins the virtual machine in $VM to the computer tier in $CT.

PS C:\> $VM = Get-SCVirtualMachine –Name "PS-Web-001"
PS C:\> $CT = Get-SCComputerTier –Name "MyService-WebTier"
PS C:\> Join-SCVirtualMachine –VM $VM –ComputerTier $CT

Example 2: Join an orphaned virtual machine to a virtual machine role

The first command gets the virtual machine named PS-Web-001, and then stores it in the $VM variable.

The second command gets the cloud resource named PetShop, and then stores it in the $VmRole variable.

The last command joins the virtual machine in $VM to the role in $VMRole.

PS C:\> $VM = Get-SCVirtualMachine –Name "PS-Web-001"
PS C:\> $VmRole = Get-CloudResource –Name "PetShop"
PS C:\> Join-SCVirtualMachine –VM $VM –VMRole $VmRole

Argomenti correlati

Get-SCComputerTier

Get-SCVirtualMachine

Move-SCVirtualMachine

New-SCVirtualMachine

Read-SCVirtualMachine

Register-SCVirtualMachine

Remove-SCVirtualMachine

Repair-SCVirtualMachine

Reset-SCVirtualMachine

Resume-SCVirtualMachine

Save-SCVirtualMachine

Set-SCVirtualMachine

Start-SCVirtualMachine

Stop-SCVirtualMachine

Suspend-SCVirtualMachine