[ Pobierz całość w formacie PDF ]
.Name -eq $VMNameToInstallVMAdditions}##################################################################### Install VM Additions or (if not possible) display an error message.####################################################################if($VM.HostType -eq "VMHost"){if($VM.VirtualDVDDrives.Count -gt 0){$VmHost = $VM.VMHost# The segment$VmHost.VirtualizationStack returns the version# of Virtual Server running on this host$IsoName = $VmHost.VirtualizationStack +" VMAdditions"$VmAdditionIso = Get-ISO | where {$_.Name -eq $IsoName}if($Null -ne $VmAdditionIso){if($LinkIso -eq $TRUE){$DvdDrive = $VM.VirtualDVDDrives[0] | set-VirtualDVDDrive -ISO $VmAdditionIso -Link -Bus $VM.VirtualDVDDrives[0].Bus -Lun $VM.VirtualDVDDrives[0].Lun}else{$DvdDrive = $VM.VirtualDVDDrives[0] | set-VirtualDVDDrive -ISO $VmAdditionIso -Bus $VM.VirtualDVDDrives[0].Bus -Lun $VM.VirtualDVDDrives[0].Lun}echo "Attached " $VmAdditionIso.Name " to VM" $VM.Name " Please start the vm if not running and install additions from dvddrive"}else{echo "Can't install vmadditions on VM " $VM.Name " as $IsoName ISO not present, please add it to library and retry"}}else{echo "Can't install vmadditions on VM " $VM.Name " has no VirtualDVDDrives present, please add a dvddrive and retry"}}else{echo "Can't install vmadditions on VM " $VM.Name " in library, please deploy to host and retry"}ConfigureGuestCluster.ps1Virtual Server 2005, on which Virtual Machine Manager is built, allows for two-node guest clusters with servers implemented as virtual machines connected to a virtual shared cluster storage device.A guest cluster supports availability of server resources and applications to clients in an environment where availability does not require hardware redundancy.You can use the ConfigureGuestCluster.ps1 script to set up two virtual machines in a two-node server cluster.How ConfigureGuestCluster.ps1WorksThe following sections explain each part of the script ConfigureGuestCluster.ps1.Define Variables for ConfigureGuestCluster.ps1The first commands in ConfigureGuestCluster.ps1 define variables that the script uses to configure a quorum disk and shared disk when setting up virtual machines in a two-node guest cluster.##################################################################### Define variables####################################################################$VMMServer = "localhost"$vmNode1Name = "VMN_1228156997"$vmNode2Name = "VMN_1480103423"$QuorumDiskSizeInGB = 3$QuorumDiskName = "QuorumDisk"$SharedDiskSizeInGB = 8$SharedDiskName = "SharedDisk"Connect to the Virtual Machine Manager ServerThe next command in ConfigureGuestCluster.ps1 connects to the Virtual Machine Manager server so that subsequent commands can access objects in the Virtual Machine Manager database.##################################################################### Connect to the Virtual Machine Manager server.####################################################################$C = Get-VMMServer $VMMServerGet the Virtual Machines to Configure as a Two-Node ClusterThe next two commands retrieve from the Virtual Machine Manager database the objects that represent the two virtual machines that you want to use in a two-node cluster and stores each virtual machine object in a variable.##################################################################### Get both virtual machine nodes.####################################################################$vmNode1 = Get-VM | where {$_.Name -eq $vmNode1Name}$vmNode2 = Get-VM | where {$_.Name -eq $vmNode2Name}Create Two Shared SCSI Adapters for the First NodeWhen you create the two-node cluster using virtual machines, you must create two shared SCSI adapters on each node.This set of commands creates two shared SCSI adapters on the first node
[ Pobierz całość w formacie PDF ]