Commit f2c65e3
libvirt: Use common naming convention for ephemeral disk labels
The _create_ephemeral() method is responsible for creating ephemeral
disks with image type "raw" and formatting them with mkfs. In the case
of [libvirt]images_type "qcow2", _create_ephemeral() will create
backing files.
Currently we are not using a consistent naming convention for choosing
the filesystem label for ephemeral disks. When we create a server for
example, we go through the disks and label them "ephemeral0",
"ephemeral1", "ephemeral2", etc.
When we hard reboot a server, there is a check to create missing
backing files and if so, a new backing file will be created but instead
of being labeled "ephemeralN" the code attempts to label them with the
name of the backing file itself for example "ephemeral_1_40d1d2c". This
will fail if the filesystem used for ephemeral disks has limitations on
the length of filesystem label names (VFAT, XFS, ...). For example:
mkfs.vfat: Label can be no longer than 11 characters
This adds a helper method for obtaining ephemeral disks filesystem
label names and uses it the same way in the few places fs_label is
specified.
Closes-Bug: #2061701
Change-Id: Id033a5760272e4fb06dee2342414b26aa16ffe24
(cherry picked from commit 82856f9)
(cherry picked from commit 09fc2fa)
(cherry picked from commit 2fd65bd)
Signed-off-by: Pierre Riteau <pierre@stackhpc.com>
(cherry picked from commit d6cdd73)
(cherry picked from commit 911cc31)
(cherry picked from commit a8c53ef)1 parent cc8940f commit f2c65e3
3 files changed
Lines changed: 20 additions & 4 deletions
File tree
- nova
- tests/unit/virt/libvirt
- virt/libvirt
- releasenotes/notes
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13830 | 13830 | | |
13831 | 13831 | | |
13832 | 13832 | | |
| 13833 | + | |
| 13834 | + | |
| 13835 | + | |
13833 | 13836 | | |
13834 | | - | |
| 13837 | + | |
13835 | 13838 | | |
13836 | 13839 | | |
13837 | 13840 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4609 | 4609 | | |
4610 | 4610 | | |
4611 | 4611 | | |
| 4612 | + | |
| 4613 | + | |
| 4614 | + | |
| 4615 | + | |
| 4616 | + | |
| 4617 | + | |
| 4618 | + | |
4612 | 4619 | | |
4613 | 4620 | | |
4614 | 4621 | | |
| |||
4715 | 4722 | | |
4716 | 4723 | | |
4717 | 4724 | | |
4718 | | - | |
| 4725 | + | |
4719 | 4726 | | |
4720 | 4727 | | |
4721 | 4728 | | |
| |||
4739 | 4746 | | |
4740 | 4747 | | |
4741 | 4748 | | |
4742 | | - | |
| 4749 | + | |
4743 | 4750 | | |
4744 | 4751 | | |
4745 | 4752 | | |
| |||
10766 | 10773 | | |
10767 | 10774 | | |
10768 | 10775 | | |
10769 | | - | |
| 10776 | + | |
10770 | 10777 | | |
10771 | 10778 | | |
10772 | 10779 | | |
| |||
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
0 commit comments