blob: 58f836dbe1d6958b966e0f89be88e2826e428b3c [file] [log] [blame]
vexxhost-botc51b5ba2024-12-12 21:43:01 -05001#######################################
2Emulated Trusted Platform Module (vTPM)
3#######################################
4
vexxhost-botb2571652024-12-13 00:26:02 -05005Atmosphere ships with the vTPM features enabled by default, so you just need
6to verify that it's setup optionally and either configure a flavor or an image
7to use it.
vexxhost-botc51b5ba2024-12-12 21:43:01 -05008
vexxhost-botb2571652024-12-13 00:26:02 -05009Verify the configuration (optional)
10===================================
vexxhost-botc51b5ba2024-12-12 21:43:01 -050011
vexxhost-botb2571652024-12-13 00:26:02 -050012You can verify that the vTPM support is activated by inspecting the traits on
13the compute nodes resource provider:
vexxhost-botc51b5ba2024-12-12 21:43:01 -050014
15.. code-block:: console
16
17 $ COMPUTE_UUID=$(openstack resource provider list --name $HOST -f value -c uuid)
18 $ openstack resource provider trait list $COMPUTE_UUID | grep SECURITY_TPM
19 | COMPUTE_SECURITY_TPM_1_2 |
20 | COMPUTE_SECURITY_TPM_2_0 |
21
vexxhost-botb2571652024-12-13 00:26:02 -050022In the example above, ``$HOST`` is the hostname of the compute node where you
23want to verify that vTPM support is enabled.
vexxhost-botc51b5ba2024-12-12 21:43:01 -050024
vexxhost-botb2571652024-12-13 00:26:02 -050025Configuring vTPM
26================
vexxhost-botc51b5ba2024-12-12 21:43:01 -050027
vexxhost-botb2571652024-12-13 00:26:02 -050028The vTPM can be configured using flavor extra specs (which requires an operator)
29or through image metadata properties which can be set by the user. There are two
30versions supported:
vexxhost-botc51b5ba2024-12-12 21:43:01 -050031
vexxhost-botb2571652024-12-13 00:26:02 -050032- 1.2
33- 2.0
vexxhost-botc51b5ba2024-12-12 21:43:01 -050034
vexxhost-botb2571652024-12-13 00:26:02 -050035In addition, there are two models supported:
36
37- TPM Interface Specification (TIS)
38- Command-Response Buffer (CRB)
39
40.. note::
41
42 The CRB model is only supported with version 2.0 which is the recommended
43 option as well.
44
45Flavor configuration
46--------------------
47
48You can use the ``hw:tpm_version`` and ``hw:tpm_model`` properties to configure
49the vTPM on a flavor. For example, to configure a flavor to use the TPM 2.0 with
50the CRB model:
vexxhost-botc51b5ba2024-12-12 21:43:01 -050051
52.. code-block:: console
53
vexxhost-botb2571652024-12-13 00:26:02 -050054 $ openstack flavor create test.vtpm \
55 --ram 512 --disk 1 --vcpus 1 \
56 --property hw:tpm_version=2.0 \
57 --property hw:tpm_model=tpm-crb
vexxhost-botc51b5ba2024-12-12 21:43:01 -050058
vexxhost-botb2571652024-12-13 00:26:02 -050059Image configuration
60-------------------
61
Dong Ma0c0ffa22025-01-17 00:08:01 +000062You can also configure the vTPM on an image using the ``hw_tpm_version`` and
63``hw_tpm_model`` image metadata properties. For example, to configure an image
64to use the TPM 2.0 with CRB model:
vexxhost-botc51b5ba2024-12-12 21:43:01 -050065
66.. code-block:: console
67
vexxhost-botb2571652024-12-13 00:26:02 -050068 $ openstack image set <image-name-or-uuid> \
Dong Ma0c0ffa22025-01-17 00:08:01 +000069 --property hw_tpm_version=2.0 \
70 --property hw_tpm_model=tpm-crb
vexxhost-botc51b5ba2024-12-12 21:43:01 -050071
vexxhost-botb2571652024-12-13 00:26:02 -050072This can be useful if you need to enable the vTPM feature without having operator
73access to the cloud or for specific images such as Windows versions that require
74a TPM to be present.
vexxhost-botc51b5ba2024-12-12 21:43:01 -050075
76Create an instance with vTPM
77============================
vexxhost-botb2571652024-12-13 00:26:02 -050078
79Once you've configured the vTPM, you can create an instance using the flavor or
80image you configured. For example, to create an instance using the flavor we
81created previously:
82
83.. code-block:: console
84
85 $ openstack server create --flavor test.vtpm test-instance
86
87Or using an image:
88
89.. code-block:: console
90
91 $ openstack server create --image <image-name-or-uuid> test-instance
92
93The instance should now have the vTPM device available.