|
| 1 | +// Module included in the following assembly: |
| 2 | +// |
| 3 | +// * virt/storage/virt-automatic-bootsource-updates.adoc |
| 4 | +// |
| 5 | + |
| 6 | +:_content-type: PROCEDURE |
| 7 | +[id="virt-enabling-volume-snapshot-boot-source_{context}"] |
| 8 | += Enabling volume snapshot boot sources |
| 9 | + |
| 10 | +Enable volume snapshot boot sources by setting the parameter in the `StorageProfile` associated with the storage class that stores operating system base images. Although `DataImportCron` was originally designed to maintain only PVC sources, `VolumeSnapshot` sources scale better than PVC sources for certain storage types. |
| 11 | + |
| 12 | +[NOTE] |
| 13 | +==== |
| 14 | +Use volume snapshots on a storage profile that is proven to scale better when cloning from a single snapshot. |
| 15 | +==== |
| 16 | + |
| 17 | +.Prerequisites |
| 18 | + |
| 19 | +* You must have access to a volume snapshot with the operating system image. |
| 20 | +* The storage must support snapshotting. |
| 21 | +
|
| 22 | +.Procedure |
| 23 | + |
| 24 | +. Open the storage profile object that corresponds to the storage class used to provision boot sources by running the following command: |
| 25 | ++ |
| 26 | +[source,terminal,subs="attributes+"] |
| 27 | +---- |
| 28 | +$ oc edit storageprofile <storage_class> -oyaml |
| 29 | +---- |
| 30 | + |
| 31 | +. Review the `dataImportCronSourceFormat` specification of the `StorageProfile` to confirm whether or not the VM is using PVC or volume snapshot by default. |
| 32 | + |
| 33 | +. Edit the storage profile, if needed, by updating the `dataImportCronSourceFormat` specification to `snapshot`. |
| 34 | ++ |
| 35 | +.Example storage profile |
| 36 | +[source,yaml] |
| 37 | +---- |
| 38 | +apiVersion: cdi.kubevirt.io/v1beta1 |
| 39 | +kind: StorageProfile |
| 40 | +metadata: |
| 41 | +# ... |
| 42 | +spec: |
| 43 | + dataImportCronSourceFormat: snapshot |
| 44 | +---- |
| 45 | + |
| 46 | +.Verification |
| 47 | + |
| 48 | +. Open the storage profile object that corresponds to the storage class used to provision boot sources. |
| 49 | ++ |
| 50 | +[source,terminal,subs="attributes+"] |
| 51 | +---- |
| 52 | +$ oc get storageprofile <storage_class> |
| 53 | +---- |
| 54 | + |
| 55 | +. Confirm that the `dataImportCronSourceFormat` specification of the `StorageProfile` is set to 'snapshot', and that any `DataSource` objects that the `DataImportCron` points to now reference volume snapshots. |
| 56 | + |
| 57 | +You can now use these boot sources to create virtual machines. |
0 commit comments