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 a cost code for an Extra charge
For a cost code for an extra charge with Usage user licenses, 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