Skip to content

Commit

Permalink
Boot_order: ensure only 1 repo is used to get boot.iso
Browse files Browse the repository at this point in the history
Issue:
VMStartError: VM 'avocado-vt-vm1' failed to start: error:
Failed to start domain 'avocado-vt-vm1'error: Cannot access storage file
'/var/lib/avocado/data/avocado-vt/boot.iso': No such file or directory(exit status: 1)

Fix:
This issue is caused by multiple repos being fetched and then their urls being concatenated together.
The fix is to ensure that only 1 repo is fetched (the last result),
which can in turn get the boot.iso file.
  • Loading branch information
rh-jugraham committed Sep 10, 2024
1 parent 2baf67c commit 8ca3f5d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def parse_cdroms_attrs(params):
cdrom_attrs_list.append(cdrom2_attrs)

if cdrom1_attrs.get('source') or cdrom2_attrs.get('source'):
cmd = "dnf repolist -v enabled |awk '/Repo-baseurl.*composes.*BaseOS.*os/ {print $NF}'"
cmd = "dnf repolist -v enabled |awk '/Repo-baseurl.*composes.*BaseOS.*os/ {res=$NF} END{print res}'"
repo_url = process.run(cmd, shell=True).stdout_text.strip()
boot_img_url = os.path.join(repo_url, 'images', 'boot.iso')
if os.path.exists(boot_img_path):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def prepare_device(params, vm_name, bootable_device):
libvirt_vmxml.modify_vm_device(vmxml, 'disk', disk_dict)
if bootable_device == "cdrom_bootable":
cdrom_path = os.path.join(data_dir.get_data_dir(), 'images', 'boot.iso')
cmd = "dnf repolist -v enabled |awk '/Repo-baseurl.*composes.*BaseOS.*os/ {print $NF}'"
cmd = "dnf repolist -v enabled |awk '/Repo-baseurl.*composes.*BaseOS.*os/ {res=$NF} END{print res}'"
repo_url = process.run(cmd, shell=True).stdout_text.strip()
boot_img_url = os.path.join(repo_url, 'images', 'boot.iso')
download.get_file(boot_img_url, cdrom_path)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def prepare_device_attrs(params, vm_name, bootable_device):
file_list.append(disk_image)
if bootable_device == "cdrom_bootable":
cdrom_path = os.path.join(data_dir.get_data_dir(), 'images', 'boot.iso')
cmd = "dnf repolist -v enabled |awk '/Repo-baseurl.*composes.*BaseOS.*os/ {print $NF}'"
cmd = "dnf repolist -v enabled |awk '/Repo-baseurl.*composes.*BaseOS.*os/ {res=$NF} END{print res}'"
repo_url = process.run(cmd, shell=True).stdout_text.strip()
boot_img_url = os.path.join(repo_url, 'images', 'boot.iso')
download.get_file(boot_img_url, cdrom_path)
Expand Down

0 comments on commit 8ca3f5d

Please sign in to comment.