diff --git a/docs/formatsecret.html.in b/docs/formatsecret.html.in index ffaa7dcfb4..216a83cca6 100644 --- a/docs/formatsecret.html.in +++ b/docs/formatsecret.html.in @@ -41,19 +41,20 @@
type
attribute specifies the usage category, currently
- only volume
, ceph
, iscsi
,
- and passphrase
are defined. Specific usage categories
- are described below.
+ only volume
, ceph
, and iscsi
+ are defined. Specific usage categories are described below.
- This secret is associated with a volume, and it is safe to delete the
- secret after the volume is deleted. The <usage
- type='volume'>
element must contain a
- single volume
element that specifies the key of the volume
+ This secret is associated with a volume, whether the format is either
+ for a "qcow" or a "luks" encrypted volume. Each volume will have a
+ unique secret associated with it and it is safe to delete the
+ secret after the volume is deleted. The
+ <usage type='volume'>
element must contain a
+ single volume
element that specifies the path of the volume
this secret is associated with. For example, create a volume-secret.xml
file as follows:
- Define the secret and set the pass phrase as follows: + Define the secret and set the passphrase as follows:
# virsh secret-define volume-secret.xml @@ -82,8 +83,8 @@
- The volume type secret can then be used in the XML for a storage volume - encryption as follows: + The volume type secret can be supplied in domain XML for a qcow storage + volume encryption as follows:
<encryption format='qcow'> @@ -91,6 +92,33 @@ </encryption>+
+ The volume type secret can be supplied either in volume XML during + creation of a storage volume + in order to provide the passphrase to encrypt the volume or in + domain XML disk device + in order to provide the passphrase to decrypt the volume, + since 2.1.0. An example follows: +
++ # cat luks-secret.xml + <secret ephemeral='no' private='yes'> + <description>LUKS Sample Secret</description> + <uuid>f52a81b2-424e-490c-823d-6bd4235bc57</uuid> + <usage type='volume'> + <volume>/var/lib/libvirt/images/luks-sample.img</volume> + </usage> + </secret> + + # virsh secret-define luks-secret.xml + Secret f52a81b2-424e-490c-823d-6bd4235bc57 created + # + # MYSECRET=`printf %s "letmein" | base64` + # virsh secret-set-value f52a81b2-424e-490c-823d-6bd4235bc57 $MYSECRET + Secret value set + # ++
This secret is associated with a Ceph RBD (rados block device). @@ -243,61 +271,5 @@ </auth> -
- This secret is a general purpose secret to be used by various libvirt - objects to provide a single passphrase as required by the object in - order to perform its authentication. For example, this secret will - be used either by the - storage volume in order to - provide the passphrase to encrypt a luks volume or by the - disk device in order to - provide the passphrase to decrypt the luks volume for usage. - Since 2.1.0. The following is an example - of a secret.xml file: -
- -- # cat secret.xml - <secret ephemeral='no' private='yes'> - <description>sample passphrase secret</description> - <usage type='passphrase'> - <name>name_example</name> - </usage> - </secret> - - # virsh secret-define secret.xml - Secret 718c71bd-67b5-4a2b-87ec-a24e8ca200dc created - - # virsh secret-list - UUID Usage - ----------------------------------------------------------- - 718c71bd-67b5-4a2b-87ec-a24e8ca200dc passphrase name_example - # - -- -
- A secret may also be defined via the
-
- virSecretDefineXML
API.
-
- Once the secret is defined, a secret value will need to be set. This
- value would be the same used to create and use the volume.
- The following is a simple example of using
- virsh secret-set-value
to set the secret value. The
-
- virSecretSetValue
API may also be used to set
- a more secure secret without using printable/readable characters.
-
- # MYSECRET=`printf %s "letmein" | base64` - # virsh secret-set-value 718c71bd-67b5-4a2b-87ec-a24e8ca200dc $MYSECRET - Secret value set - --