To assign extra charges with cost codes to a VM:
Privileges: View virtual machine extra charges, Manage virtual machine extra charges
Edit the VM
Go to Extra charges
Click the + add button
Select an Extra charge with a cost code
For an extra charge a cost code with
Usage user licenses
unit, enter the number of Users for the VM
After you finish editing the VM, click Save
You cannot change extra charges with cost codes that are inherited from the hardware profile or template