Skip to content

Commit bfa9f3c

Browse files
authored
Merge pull request #200 from stackhpc/upstream/zed-2026-05-04
Synchronise zed with upstream
2 parents 6ecb0fc + a8c53ef commit bfa9f3c

3 files changed

Lines changed: 20 additions & 4 deletions

File tree

nova/tests/unit/virt/libvirt/test_driver.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14312,8 +14312,11 @@ def test_create_images_and_backing_ephemeral_gets_created(
1431214312
'ephemeral_foo')
1431314313
]
1431414314

14315+
# This also asserts that the filesystem label name is generated
14316+
# correctly as 'ephemeral0' to help prevent regression of the
14317+
# related bug fix from https://launchpad.net/bugs/2061701
1431514318
create_ephemeral_mock.assert_called_once_with(
14316-
ephemeral_size=1, fs_label='ephemeral_foo',
14319+
ephemeral_size=1, fs_label='ephemeral0',
1431714320
os_type='linux', target=ephemeral_backing)
1431814321

1431914322
fetch_image_mock.assert_called_once_with(

nova/virt/libvirt/driver.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4635,6 +4635,13 @@ def _inject_data(self, disk, instance, injection_info):
46354635
{'img_id': img_id, 'e': e},
46364636
instance=instance)
46374637

4638+
@staticmethod
4639+
def _get_fs_label_ephemeral(index: int) -> str:
4640+
# Use a consistent naming convention for FS labels. We need to be
4641+
# mindful of various filesystems label name length limitations.
4642+
# See for example: https://bugs.launchpad.net/nova/+bug/2061701
4643+
return f'ephemeral{index}'
4644+
46384645
# NOTE(sileht): many callers of this method assume that this
46394646
# method doesn't fail if an image already exists but instead
46404647
# think that it will be reused (ie: (live)-migration/resize)
@@ -4750,7 +4757,7 @@ def raw(fname, disk_info_mapping=None):
47504757
created_disks = created_disks or not disk_image.exists()
47514758

47524759
fn = functools.partial(self._create_ephemeral,
4753-
fs_label='ephemeral0',
4760+
fs_label=self._get_fs_label_ephemeral(0),
47544761
os_type=instance.os_type,
47554762
is_block_dev=disk_image.is_block_dev,
47564763
vm_mode=vm_mode)
@@ -4776,7 +4783,7 @@ def raw(fname, disk_info_mapping=None):
47764783
raise exception.InvalidBDMFormat(details=msg)
47774784

47784785
fn = functools.partial(self._create_ephemeral,
4779-
fs_label='ephemeral%d' % idx,
4786+
fs_label=self._get_fs_label_ephemeral(idx),
47804787
os_type=instance.os_type,
47814788
is_block_dev=disk_image.is_block_dev,
47824789
vm_mode=vm_mode)
@@ -10980,7 +10987,7 @@ def _create_images_and_backing(self, context, instance, instance_dir,
1098010987
# cached.
1098110988
disk.cache(
1098210989
fetch_func=self._create_ephemeral,
10983-
fs_label=cache_name,
10990+
fs_label=self._get_fs_label_ephemeral(0),
1098410991
os_type=instance.os_type,
1098510992
filename=cache_name,
1098610993
size=info['virt_disk_size'],
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
fixes:
2+
- |
3+
Fixed an issue where certain server actions could fail for servers with
4+
ephemeral disks due to filesystem label name length limitations
5+
(VFAT, XFS, ...). Filesystem label name generation has been fixed for these
6+
cases. See https://launchpad.net/bugs/2061701 for more details.

0 commit comments

Comments
 (0)