6ae9ed
From 778fbc28f6ae7f40082d48bc57c224cd7a8d45d0 Mon Sep 17 00:00:00 2001
6ae9ed
Message-Id: <778fbc28f6ae7f40082d48bc57c224cd7a8d45d0@dist-git>
6ae9ed
From: John Ferlan <jferlan@redhat.com>
6ae9ed
Date: Mon, 25 Jul 2016 12:42:52 -0400
6ae9ed
Subject: [PATCH] docs: Update docs to reflect LUKS secret changes
6ae9ed
6ae9ed
https://bugzilla.redhat.com/show_bug.cgi?id=1301021
6ae9ed
6ae9ed
Commit id's 'c8438010', '9bbf0d7e', and '2552fec24' altered the documentation
6ae9ed
to describe adding a 'passphrase' type secret usage model in order to reference
6ae9ed
the secret for a luks volume. After commit, it was deemed that a 'volume'
6ae9ed
usage model should be used, so adjust the various documents in order rephrase
6ae9ed
descriptions in order to follow the correct usage model.
6ae9ed
6ae9ed
Signed-off-by: John Ferlan <jferlan@redhat.com>
6ae9ed
(cherry picked from commit a6bab5c34313497f80e8bbae5a5da405d3c4264b)
6ae9ed
6ae9ed
Resolved some minor formatting conflicts from docs/formatsecret.html.in
6ae9ed
since commit id 'c84380106fe69f86842dc7e8c032af6740bef77e' is not present
6ae9ed
for downstream
6ae9ed
6ae9ed
Signed-off-by: John Ferlan <jferlan@redhat.com>
6ae9ed
---
6ae9ed
 docs/formatsecret.html.in            | 45 +++++++++++++++++++++++++++++-------
6ae9ed
 docs/formatstorage.html.in           | 16 +++++++++++++
6ae9ed
 docs/formatstorageencryption.html.in | 29 ++++++++++-------------
6ae9ed
 3 files changed, 65 insertions(+), 25 deletions(-)
6ae9ed
6ae9ed
diff --git a/docs/formatsecret.html.in b/docs/formatsecret.html.in
6ae9ed
index c39d2a7..fd698a4 100644
6ae9ed
--- a/docs/formatsecret.html.in
6ae9ed
+++ b/docs/formatsecret.html.in
6ae9ed
@@ -41,7 +41,7 @@
6ae9ed
       
6ae9ed
         Specifies what this secret is used for.  A mandatory
6ae9ed
         type attribute specifies the usage category, currently
6ae9ed
-        only volume, ceph and iscsi
6ae9ed
+        only volume, ceph, and iscsi
6ae9ed
         are defined. Specific usage categories are described below.
6ae9ed
       
6ae9ed
     
6ae9ed
@@ -49,10 +49,12 @@
6ae9ed
     

Usage type "volume"

6ae9ed
 
6ae9ed
     

6ae9ed
-      This secret is associated with a volume, and it is safe to delete the
6ae9ed
-      secret after the volume is deleted.  The <usage
6ae9ed
-      type='volume'> element must contain a
6ae9ed
-      single volume element that specifies the key of the volume
6ae9ed
+      This secret is associated with a volume, whether the format is either
6ae9ed
+      for a "qcow" or a "luks" encrypted volume. Each volume will have a
6ae9ed
+      unique secret associated with it and it is safe to delete the
6ae9ed
+      secret after the volume is deleted. The
6ae9ed
+      <usage type='volume'> element must contain a
6ae9ed
+      single volume element that specifies the path of the volume
6ae9ed
       this secret is associated with. For example, create a volume-secret.xml
6ae9ed
       file as follows:
6ae9ed
     

6ae9ed
@@ -68,7 +70,7 @@
6ae9ed
     
6ae9ed
 
6ae9ed
     

6ae9ed
-      Define the secret and set the pass phrase as follows:
6ae9ed
+      Define the secret and set the passphrase as follows:
6ae9ed
     

6ae9ed
     
6ae9ed
       # virsh secret-define volume-secret.xml
6ae9ed
@@ -81,8 +83,8 @@
6ae9ed
     
6ae9ed
 
6ae9ed
     

6ae9ed
-      The volume type secret can then be used in the XML for a storage volume
6ae9ed
-      encryption as follows:
6ae9ed
+      The volume type secret can be supplied in domain XML for a qcow storage
6ae9ed
+      volume encryption as follows:
6ae9ed
     

6ae9ed
     
6ae9ed
       <encryption format='qcow'>
6ae9ed
@@ -90,6 +92,33 @@
6ae9ed
       </encryption>
6ae9ed
     
6ae9ed
 
6ae9ed
+    

6ae9ed
+      The volume type secret can be supplied either in volume XML during
6ae9ed
+      creation of a storage volume
6ae9ed
+      in order to provide the passphrase to encrypt the volume or in
6ae9ed
+      domain XML disk device
6ae9ed
+      in order to provide the passphrase to decrypt the volume,
6ae9ed
+      since 2.1.0. An example follows:
6ae9ed
+    

6ae9ed
+    
6ae9ed
+      # cat luks-secret.xml
6ae9ed
+      <secret ephemeral='no' private='yes'>
6ae9ed
+         <description>LUKS Sample Secret</description>
6ae9ed
+         <uuid>f52a81b2-424e-490c-823d-6bd4235bc57</uuid>
6ae9ed
+         <usage type='volume'>
6ae9ed
+            <volume>/var/lib/libvirt/images/luks-sample.img</volume>
6ae9ed
+         </usage>
6ae9ed
+      </secret>
6ae9ed
+
6ae9ed
+      # virsh secret-define luks-secret.xml
6ae9ed
+      Secret f52a81b2-424e-490c-823d-6bd4235bc57 created
6ae9ed
+      #
6ae9ed
+      # MYSECRET=`printf %s "letmein" | base64`
6ae9ed
+      # virsh secret-set-value f52a81b2-424e-490c-823d-6bd4235bc57 $MYSECRET
6ae9ed
+      Secret value set
6ae9ed
+      #
6ae9ed
+    
6ae9ed
+
6ae9ed
     

Usage type "ceph"

6ae9ed
     

6ae9ed
       This secret is associated with a Ceph RBD (rados block device).
6ae9ed
diff --git a/docs/formatstorage.html.in b/docs/formatstorage.html.in
6ae9ed
index 94277a1..a700e85 100644
6ae9ed
--- a/docs/formatstorage.html.in
6ae9ed
+++ b/docs/formatstorage.html.in
6ae9ed
@@ -752,5 +752,21 @@
6ae9ed
           </permissions>
6ae9ed
         </target>
6ae9ed
       </volume>
6ae9ed
+
6ae9ed
+    

Storage volume using LUKS

6ae9ed
+
6ae9ed
+    
6ae9ed
+      <volume>
6ae9ed
+        <name>MyLuks.img</name>
6ae9ed
+        <capacity unit="G">5</capacity>
6ae9ed
+        <target>
6ae9ed
+          <path>/var/lib/virt/images/MyLuks.img</path>
6ae9ed
+          <format type='luks'/>
6ae9ed
+          <encryption format='luks'>
6ae9ed
+            <secret type='passphrase' uuid='f52a81b2-424e-490c-823d-6bd4235bc572'/>
6ae9ed
+          </encryption>
6ae9ed
+        </target>
6ae9ed
+      </volume>
6ae9ed
+    
6ae9ed
   </body>
6ae9ed
 </html>
6ae9ed
diff --git a/docs/formatstorageencryption.html.in b/docs/formatstorageencryption.html.in
6ae9ed
index f2b0ffd..11af97e 100644
6ae9ed
--- a/docs/formatstorageencryption.html.in
6ae9ed
+++ b/docs/formatstorageencryption.html.in
6ae9ed
@@ -27,9 +27,9 @@
6ae9ed
       secret tags, each with mandatory attributes type
6ae9ed
       and either uuid or usage
6ae9ed
       (since 2.1.0). The only currently defined
6ae9ed
-      value of type is passphrase. The
6ae9ed
+      value of type is volume. The
6ae9ed
       uuid is "uuid" of the secret while
6ae9ed
-      usage is the value "usage" subelement field.
6ae9ed
+      usage is the "usage" subelement field.
6ae9ed
       A secret value can be set in libvirt by the
6ae9ed
       
6ae9ed
       virSecretSetValue API. Alternatively, if supported
6ae9ed
@@ -40,7 +40,7 @@
6ae9ed
     

"default" format

6ae9ed
     

6ae9ed
       <encryption format="default"/> can be specified only
6ae9ed
-      when creating a volume.  If the volume is successfully created, the
6ae9ed
+      when creating a qcow volume.  If the volume is successfully created, the
6ae9ed
       encryption formats, parameters and secrets will be auto-generated by
6ae9ed
       libvirt and the attached encryption tag will be updated.
6ae9ed
       The unmodified contents of the encryption tag can be used
6ae9ed
@@ -59,13 +59,9 @@
6ae9ed
     

"luks" format

6ae9ed
     

6ae9ed
       The luks format is specific to a luks encrypted volume
6ae9ed
-      and the secret used in order to either encrypt or decrypt the volume.
6ae9ed
-      A single <secret type='passphrase'...> element is
6ae9ed
-      expected. The secret may be referenced via either a uuid or
6ae9ed
-      usage attribute. One of the two must be present. When
6ae9ed
-      present for volume creation, the secret will be used in order for
6ae9ed
-      volume encryption.  When present for domain usage, the secret will
6ae9ed
-      be used as the passphrase to decrypt the volume.
6ae9ed
+      and the secret is used in order to either encrypt during volume creation
6ae9ed
+      or decrypt the volume for usage by the domain. A single
6ae9ed
+      <secret type='passphrase'...> element is expected.
6ae9ed
       Since 2.1.0.
6ae9ed
     

6ae9ed
     

6ae9ed
@@ -135,22 +131,21 @@
6ae9ed
       </encryption>
6ae9ed
 
6ae9ed
     

6ae9ed
-      Assuming a 
6ae9ed
-      luks secret is already defined using a
6ae9ed
-      usage element with an name of "luks_example",
6ae9ed
+      Assuming a 
6ae9ed
+      luks volume type secret is already defined,
6ae9ed
       a simple example specifying use of the luks format
6ae9ed
       for either volume creation without a specific cipher being defined or
6ae9ed
       as part of a domain volume definition:
6ae9ed
     

6ae9ed
     
6ae9ed
       <encryption format='luks'>
6ae9ed
-         <secret type='passphrase' usage='luks_example'/>
6ae9ed
+        <secret type='passphrase' uuid='f52a81b2-424e-490c-823d-6bd4235bc572'/>
6ae9ed
       </encryption>
6ae9ed
     
6ae9ed
 
6ae9ed
     

6ae9ed
-      Here is an example, specifying use of the luks format for
6ae9ed
-      a specific cipher algorihm for volume creation:
6ae9ed
+      Here is an example specifying use of the luks format for
6ae9ed
+      a specific cipher algorithm for volume creation:
6ae9ed
     

6ae9ed
     
6ae9ed
       <volume>
6ae9ed
@@ -160,7 +155,7 @@
6ae9ed
           <path>/var/lib/libvirt/images/demo.luks</path>
6ae9ed
           <format type='luks'/>
6ae9ed
           <encryption format='luks'>
6ae9ed
-             <secret type='passphrase' usage='luks_example'/>
6ae9ed
+             <secret type='passphrase' uuid='f52a81b2-424e-490c-823d-6bd4235bc572'/>
6ae9ed
              <cipher name='twofish' size='256' mode='cbc' hash='sha256'/>
6ae9ed
              <ivgen name='plain64' hash='sha256'/>
6ae9ed
           </encryption>
6ae9ed
-- 
6ae9ed
2.9.2
6ae9ed