Mastering VMware vSphere 6. Marshall Nick

Mastering VMware vSphere 6 - Marshall Nick


Скачать книгу
managed via PowerCLI. You’ll use the New-DeployRule and Add-DeployRule commands to define new deployment rules and add them to the working rule set, respectively.

      Perform the following steps to define a new deployment rule:

      1. In a PowerCLI session where you’ve previously connected to vCenter Server and defined an image profile, use the New-DeployRule command to define a new deployment rule that matches an image profile to a physical host:

      New-DeployRule –Name"Img_Rule" –Item"My_Custom_Profile"–Pattern"vendor=Cisco","ipv4=10.1.1.225,10.1.1.250"

      This rule assigns the image profile named My_Custom_Profile to all hosts with Cisco in the vendor string and that have the IP address 10.1.1.225 or 10.1.1.250. You could also specify an IP range like 10.1.1.225-10.1.1.250 (using a hyphen to separate the start and end of the IP address range).

      2. Next, create a deployment rule that assigns the ESXi host to a cluster within vCenter Server:

      New-DeployRule –Name"Default_Cluster" –Item"Cluster-1" – AllHosts

      This rule puts all hosts into the cluster named Cluster-1 in the vCenter Server with which the Auto Deploy server is registered. (Recall that an Auto Deploy server must be registered with a vCenter Server instance.)

      3. Add these rules to the working rule set:

      Add-DeployRule Img_Rule

      Add-DeployRule Default_Cluster

      As soon as you add the deployment rules to the working rule set, vSphere Auto Deploy will, if necessary, start uploading VIBs to the Auto Deploy server in order to satisfy the rules you’ve defined.

      4. Verify that these rules have been added to the working rule set with the Get-DeployRuleSet command.

Now that a deployment rule is in place, you’re ready to provision via Auto Deploy. Boot the physical host that matches the patterns you defined in the deployment rule, and it should follow the boot sequence described at the start of this section. Figure 2.9 shows how it looks when a host is booting ESXi via vSphere Auto Deploy.

images

Figure 2.9 Note the differences in the ESXi boot process when using Auto Deploy versus a traditional installation of ESXi.

      By now, you should be seeing the flexibility Auto Deploy offers. If you have to deploy a new ESXi image, you need only define a new image profile (using a new software depot, if necessary), assign that image profile with a deployment rule, and reboot the physical servers. When the servers come up, they will boot the newly assigned ESXi image via PXE.

      Of course, there are some additional concerns that you’ll need to address should you decide to go this route:

      • The image profile doesn’t contain any ESXi configuration state information, such as virtual switches, security settings, advanced parameters, and so forth. Host profiles are used to store this configuration state information in vCenter Server and pass that configuration information down to a host automatically. You can use a deployment rule to assign a host profile, or you can assign a host profile to a cluster and then use a deployment rule to join hosts to a cluster. We’ll describe host profiles in greater detail in Chapter 3.

      • State information such as log files, generated private keys, and so forth is stored in host memory and is lost during a reboot. Therefore, you must configure additional settings such as setting up syslog for capturing the ESXi logs. Otherwise, this vital operational information is lost every time the host is rebooted. The configuration for capturing this state information can be included in a host profile that is assigned to a host or cluster.

      In the Auto Deploy Stateless mode, the ESXi image doesn’t contain configuration state and doesn’t maintain dynamic state information, and they are therefore considered stateless ESXi hosts. All the state information is stored elsewhere instead of on the host itself.

      Ensuring auto deploy is available

      When working with a customer with vSphere 5.0 Auto Deploy, I had to ensure that all Auto Deploy components were highly available. This meant designing the infrastructure responsible for booting and deploying ESXi hosts was more complicated than normal. Services such as PXE and Auto Deploy and the vCenter VMs were all deployed on hosts that were not provisioned using Auto Deploy in a separate management cluster.

      As per the Highly Available Auto Deploy best practices in the vSphere documentation, building a separate cluster with a local installation or boot from SAN will ensure there is no chicken-and-egg situation. You need to ensure that in a completely virtualized environment, your VMs that provision ESXi hosts with Auto Deploy are not running on the ESXi hosts they need to build.

      Stateless Caching Mode

      Unless your ESXi host hardware does not have any local disks or bootable SAN storage, I would recommend considering one of the two other Auto Deploy modes. These modes offer resiliency for your hosts if at any time the Auto Deploy services become unavailable.

      To configure Stateless Caching, follow the previous procedure for Stateless with these additions:

      1. Within vCenter, navigate to the Host Profiles section: vCenter inline Home Host Profiles.

      2. Create a new host profile or edit the existing one attached to your host.

      3. Navigate to System Image Cache Configuration under Advanced Configuration Settings.

      4. Select Enable Stateless Caching On The Host.

      5. Input the disk configuration details, using the same disk syntax as listed earlier in the section “Performing an Unattended Installation of VMware ESXi.” By default it will populate the first available disk, as you can see in Figure 2.10.

      6. Click Finish to end the Host Profile Wizard.

      7. Next you need to configure the boot order in the host BIOS to boot from the network first, and the local disk second. This procedure will differ depending on your server type.

      8. Reboot the host to allow a fresh Auto Deploy image and the new host profile will be attached.

images

Figure 2.10 Editing the host profile to allow Stateless Caching on a local disk

      This configuration tells the ESXi host to take the Auto Deploy image loaded in memory and save it to the local disk after a successful boot. If for some reason the network or Auto Deploy server is unavailable when your host reboots, it will fall back and boot the cached copy on its local disk.

      Stateful Mode

      Just like Stateful Caching mode, the Auto Deploy Stateful mode is configured by editing host profiles within vCenter and the boot order settings in the host BIOS.

      1. Within vCenter, navigate to the Host Profiles section: vCenter inline Home Host Profiles.

      2. Create a new host profile or edit the existing one attached to your host.

      3. Navigate to System Image Cache Configuration under Advanced Configuration Settings.

      4. Select Enable Stateful Installs On The Host.

      5. Input the disk configuration details, using the same disk syntax as listed earlier in the section “Performing an Unattended Installation of VMware ESXi.” By default it will populate the first available disk (see Figure 2.10).

      6. Click Finish to end the Host Profile Wizard.

      7. Next you need to configure the boot order in the host BIOS to boot from the local disk first, and the network second. This procedure will differ depending on your server type.

      8. The host will boot into Maintenance mode, and you must apply


Скачать книгу