Licensing a physical server

You can license a physical server whether it is a single bare metal host or running multiple virtual machines.

You can determine the number of Virtual Processor Cores (VPCs) to license on a physical server in three ways:

  • Determine the number of physical cores on the machine
  • db2pd –osinfo command
  • db2diag command

Using the number of physical cores to determine the number of VPCs to license

The number of physical cores on your physical server is equivalent to the number of VPCs used by the program. You can license a physical server whether it is single bare metal host or running multiple virtual machines. For hybrid environments, you can either license the number of physical cores on the machine or you can license the sum of the virtual cores on the machine. Choose whichever results in the lesser number.

Using the db2pd command to determine the number of VPCs to license

  1. Run the db2pd –osinfo command to return the server’s environment variables. If you have multiple servers, you must run the command on each server.
  2. If you have an HMTDegree value of ‘1’, the OnlineCPU value is equivalent to the number of VPCs you must license. Virtual machines always have an HMTDegree value of ‘1’.
  3. Use the following formula to find the number of VPCs you must license: Number of VPCs to license = OnlineCPU / HMTDegree

Using the db2diag command to determine the number of VPCs to license

  1. If you are on Windows, run the following command: db2diag -g data:=“System Info”. If you are on Linux/Unix, run the following command: db2diag -g data:='System Info'
  2. Similar to the db2pd command, this command returns the number of online CPUs and the HMT degree, displayed as “Threading degree per core”.
  3. Use the following formula to find the number of VPCs you must license: Number of VPCs to license = OnlineCPU / HMTDegree

Examples

Scenario 1 - physical server deployment

If you set up a Windows server in the following environment:
  • It is deployed on a two-socket server with eight cores per processor and hyper-threading turned on to a degree of 2 (16 physical cores).
  • The operating system shows 32 CPUs available.
Take the following steps to find the number of VPCs:
  1. Run the db2pd -osinfo command. An HMTDegree of 2 and an OnlineCPU of 32 is returned.
  2. License 16 VPCs for this environment.
Note: The actual number of cores is determined by: VPC = OnlineCPU / HMTDegree = 32/2 = 16

Scenario 2 - single VM environment on a physical server

If you set up a Db2® instance for six VPCs in the following environment:
  • The VMware is deployed on a two-socket server with eight cores per processor and hyper-threading turned on to a degree of 2 (32 virtual cores or 16 physical cores).
  • The VMware reports six virtual processors.
Take the following steps to find the number of VPCs:
  1. Run the db2pd -osinfo command. An HMTDegree of 1 and an OnlineCPU of 6 is returned.
  2. License six VPCs for this environment.

Scenario 3 - heavy virtualization on a single machine

If you deploy multiple VMware hosts on a server to run Db2 with the following environment:
  • Db2 is running on a two-socket server with eight cores per processor and hyper-threading turned on to a degree of 2 (16 physical cores).
  • Three of the VM images report 16 virtual cores, and the other two VM images report eight virtual cores.
Take the following steps to find the number of VPCs:
  1. Run the db2pd-osinfo command across all VMware hosts. The VMware hosts return an HMTDegree of 1 for each virtual machine and a total OnlineCPU of 64 across the five virtual machines.
  2. License 16 VPCs for this environment.
Note: Since the hardware can be physically identified as a 16-core server, you must pay for 16 VPCs only, not 64.