Translate

Total Pageviews

My YouTube Channel

Wednesday, 3 September 2014

Set Up Bulk Licensing with Auto Deploy

You can use the vSphere Client or ESXi Shell to specify individual license keys, or you can set up bulk licensing by using PowerCLI cmdlets. Bulk licensing works for all ESXi hosts, but is especially useful for hosts provisioned with Auto Deploy.
The following example assigns licenses to all hosts in a data center. You can also associate licenses with hosts and clusters.
The following example is for advanced PowerCLI users who know how to use PowerShell variables.
Install PowerCLI.
Assigning license keys through the vSphere Client or assigning licensing by using PowerCLI cmdlets function differently.
Assign license keys with vSphere Client
You can assign license keys to a host when you add the host to the vCenter Server system or when the host is managed by a vCenter Server system.
Assign license keys with LicenseDataManager PowerCLI
You can specify a set of license keys to be added to a set of hosts. The license keys are added to the vCenter Server database. Each time a host is added to the vCenter Server system or reconnects to the vCenter Server system, the host is assigned a license key. A license key that is assigned through the PowerCLI is treated as a default license key. When an unlicensed host is added or reconnected, it is assigned the default license key. If a host is already licensed, it keeps its license key.
1
Connect to the vCenter Server system you want to use and bind the associated license manager to a variable.
Connect-VIServer -Server 192.XXX.X.XX -User username -Password password
$licenseDataManager = Get-LicenseDataManager
2
Run a cmdlet that retrieves the datacenter in which the hosts for which you want to use the bulk licensing feature are located.
$hostContainer = Get-Datacenter -Name Datacenter-X
You can also run a cmdlet that retrieves a cluster to use bulk licensing for all hosts in a cluster, or retrieves a folder to use bulk licensing for all hosts in a folder.
3
Create a new LicenseData object and a LicenseKeyEntry object with associated type ID and license key.
$licenseData = New-Object VMware.VimAutomation.License.Types.LicenseData
$licenseKeyEntry = New-Object Vmware.VimAutomation.License.Types.LicenseKeyEntry
$licenseKeyEntry.TypeId = "vmware-vsphere”
$licenseKeyEntry.LicenseKey = "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX"
4
Associate the LicenseKeys attribute of the LicenseData object you created in step 3 with the LicenseKeyEntry object.
$licenseData.LicenseKeys += $licenseKeyEntry
5
Update the license data for the data center with the LicenseData object and verify that the license is associated with the host container.
$licenseDataManager.UpdateAssociatedLicenseData($hostContainer.Uid, $licenseData)
$licenseDataManager.QueryAssociatedLicenseData($hostContainer.Uid)
6
Provision one or more hosts with Auto Deploy and assign them to the data center or to the cluster that you assigned the license data to.
7
Verify that the host is successfully assigned to the default license XXXXX-XXXXX-XXXXX-XXXXX-XXXXX.
a
Using a vSphere Client, log in to the vCenter Server system.
b
Navigate to the Configuration > License Features tab for the host and check that the correct license is displayed.
All hosts that you assigned to the data center are now licensed automatically.
Info taken from VMware Documentation

Auto Deploy Boot Process

When you turn on a host that you want to provision or reprovision with vSphere Auto Deploy, the Auto Deploy infrastructure supplies the image profile and, optionally, a host profile and a vCenter Server location for that host.
The boot process is different for hosts that have not yet been provisioned with Auto Deploy (first boot) and for hosts that have been provisioned with Auto Deploy and added to a vCenter Server system (subsequent boot).

Before a first boot process, you must set up your system. Setup includes the following tasks, which are discussed in more detail in Preparing for vSphere Auto Deploy.

■
Set up a DHCP server that assigns an IP address to each host upon startup and that points the host to the TFTP server to download the gPXE boot loader from.
■
Ensure that the Auto Deploy server has an IPv4 address. PXE booting is supported only with IPv4.
■
Identify an image profile to be used in one of the following ways.

■
Choose an ESXi image profile in a public depot.
■
(Optional) Create a custom image profile by using the Image Builder PowerCLI, and place the image profile in a depot that the Auto Deploy server can access. The image profile must include a base ESXi VIB.
■
(Optional) If you have a reference host in your environment, export the host profile of the reference host and define a rule that applies the host profile to one or more hosts.
■
Specify rules for the deployment of the host and add the rules to the active rule set.

When a host that has not yet been provisioned with vSphere Auto Deploy boots (first boot), the host interacts with several Auto Deploy components.

1
When the administrator turns on a host, the host starts a PXE boot sequence.
The DHCP Server assigns an IP address to the host and instructs the host to contact the TFTP server.
2
The host contacts the TFTP server and downloads the gPXE file (executable boot loader) and a gPXE configuration file.
3
gPXE starts executing.
The configuration file instructs the host to make a HTTP boot request to the Auto Deploy server. The HTTP request includes hardware and network information.
4
In response, the Auto Deploy server performs these tasks:

a
Queries the rule engine for information about the host.
b
Streams the components specified in the image profile, the optional host profile, and optional vCenter Server location information.
5
The host boots using the image profile.
If the Auto Deploy server provided a host profile, the host profile is applied to the host.
6
Auto Deploy assigns the host to the vCenter Server system that Auto Deploy is registered with.

a
If a rule specifies a target folder or cluster on the vCenter Server system, the host is placed in that folder or cluster.
b
If no rule exists that specifies a vCenter Server inventory location, Auto Deploy adds the host to the first datacenter displayed in the vSphere Client UI.
7
(Optional) If the host profile requires the user to specify certain information, such as a static IP address, the host is placed in maintenance mode when the host is added to the vCenter Server system.
You must reapply the host profile and answer any questions to have the host exit maintenance mode. See Applying a Host Profile to Prompt for User Input.
8
If the host is part of a DRS cluster, virtual machines from other hosts might be assigned to the host after the host has successfully been added to the vCenter Server system.

Auto Deploy Installation, First Boot
The flow of the Auto Deploy first boot is shown. When the host starts the PXE boot process, it sends hardware and network information to the Auto Deploy Server, which returns host and image profiles to the host. The host boots using the image profile, and the host is then assigned to a vCenter Server, which stores host and image profiles.

For hosts that are provisioned with Auto Deploy and managed by a vCenter Server system, subsequent boots can become completely automatic. The host is provisioned by the vCenter Server system, which stores information about the image profile and host profile for each host in the database.
The boot process proceeds as follows.

1
The administrator reboots the host.
2
As the host boots up, Auto Deploy provisions the host with its image profile and host profile, which are stored in vCenter Server.
3
Virtual machines are brought up or migrated to the host based on the settings of the host.

■
Standalone host. Virtual machines are powered on according to autostart rules defined on the host.
■
DRS cluster host. Virtual machines that were successfully migrated to other hosts stay there. Virtual machines for which no host had enough resources are registered to the rebooted host.
If the vCenter Server system is unavailable, the host contacts the Auto Deploy server for image profiles and host profiles and the host reboots. However, Auto Deploy cannot set up vSphere distributed switches if vCenter Server is unavailable, and virtual machines are assigned to hosts only if they participate in an HA cluster. Until the host is reconnected to vCenter Server and the host profile is applied, the switch cannot be created. Because the host is in maintenance mode, virtual machines cannot start. See Reprovision Hosts with Simple Reboot Operations.
Any hosts that are set up to require user input are placed in maintenance mode. See Applying a Host Profile to Prompt for User Input.

You can change the image profile, host profile, or vCenter Server location for hosts. The process includes changing rules and testing and repairing the host's rule compliance.

1
The administrator uses the Copy-DeployRule PowerCLI cmdlet to copy and edit one or more rules and updates the rule set. See Auto Deploy Roadmap for an example.
2
The administrator runs the Test-DeployRulesetCompliance cmdlet to check whether each host is using the information the current rule set specifies.
3
The host returns a PowerCLI object that encapsulates compliance information.
4
The administrator runs the Repair-DeployRulesetCompliance cmdlet to update the image profile, host profile, or vCenter Server location the vCenter Server system stores for each host.
5
When the host reboots, it uses the updated image profile, host profile, or vCenter Server location for the host.
If the host profile is set up to request user input, the host is placed in maintenance mode. Follow the steps in Applying a Host Profile to Prompt for User Input.

Auto Deploy Installation, Subsequent Boots
The graphic shows the flow of Auto Deploy boots subsequent to the first boot. When the host is rebooted, the vCenter Server provisions the host using the existing image profile, or, optionally, uses an image profile that has been updated and stored in vCenter Server.

You can configure the host profile of an Auto Deploy reference host with a distributed switch.
When you configure the distributed switch, the boot configuration parameters policy is automatically set to match the network parameters required for host connectivity after a reboot.
When Auto Deploy provisions the ESXi host with the host profile, the host goes through a two-step process.

1
The host creates a standard virtual switch with the properties specified in the boot configuration parameters field.
2
The host creates the VMkernel NICs. The VMkernel NICs allow the host to connect to Auto Deploy and to the vCenter Server system.
When the host is added to vCenter Server, vCenter Server removes the standard switch and reapplies the distributed switch to the host.
Info taken from VMware Documentation

Monday, 1 September 2014

Understanding the vpxuser Account




When vCenter Server is present, all activities are funneled through vCenter Server using Windows accounts that have been assigned a role that has, in turn, been assigned to one or more inventory objects as a permission. This combination of Windows account, role, and inventory object creates a permission that allows (or disallows) the user to perform certain functions. The user accounts exist in Active Directory (or on the vCenter Server computer itself), not on the ESXi hosts, and the permissions and roles are defined within vCenter Server, not on the ESXi hosts. Because the user doesn’t log into the ESXi host directly, this minimizes the need for many local user accounts on the ESXi host and thus provides better security. Alas, there still is a need, however small or infrequent, for local accounts on an ESXi host used primarily for administration, which is why I talked earlier about managing local users and groups and integrating ESXi authentication into Active Directory.

Because the user accounts exist outside the ESXi hosts, and because the roles, privileges, and permissions are defined outside the ESXi hosts, when you use vCenter Server to manage your
virtual infrastructure, you are reallyonly creating a task and not directly interacting with the ESXi hosts or the VMs. This is true for any user using vCenter Server to manage hosts or VMs. For instance, Shane, an administrator, wants to log into vCenter Server and create a new VM. Shane first needs the proper role — perhaps a custom role you created specifically for the purpose of creating new VMs — assigned to the proper inventory object or objects within vCenter Server.



         Assuming the correct role has been assigned to the correct inventory objects — let’s say it’s a resource pool — Shane has what he needs to create, modify, and monitor VMs. But does Shane’s user account have direct access to the ESXi hostswhen he’s logged into vCenter Server? No, it does not. In fact, a proxy account is used to communicate Shane’s tasks tothe appropriate ESXi host or VM. This account, vpxuser, isthe only account that vCenter Server stores and tracks in its backend database.
 


 
Anytime vCenter Server polls an ESXi host or an administrator creates a task that needs to be communicated to an ESXi host, the vpxuser account is used. On the ESXi hosts that are managed by vCenter Server, the vpxuser account exists (it’s created automatically by vCenter Server; this is why vCenter Server asks you for the root passwordwhen adding a host to the inventory) and is assigned the Administrator role. This gives the vpxuser account the ability to perform whatever tasks are necessary on the individual ESXi hosts managed by vCenter Server. When a user logs into vCenter Server, vCenter Server applies its security model (roles, privileges, and permissions) to that user, ensuring that the user is only permitted to perform the tasks for which they are authorized. On the backend, though, all these tasks are proxied onto the individual ESXi hosts as vpxuser.
 Info taken from Mastering VMware vSphere Guide