Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not reconfigure a VM with context disk type=block #6689

Closed
3 tasks
atodorov-storpool opened this issue Aug 9, 2024 · 0 comments
Closed
3 tasks

Could not reconfigure a VM with context disk type=block #6689

atodorov-storpool opened this issue Aug 9, 2024 · 0 comments

Comments

@atodorov-storpool
Copy link
Contributor

Description
This is another perspective of issue #6688. Please feel free to merge it although it is regarding another component of of opennebula (the VMM_MAD for KVM).

When a the contextualization CDROM is a block device an extra argument --block should be added to the change-media command used by the vmm/reconfigre script.

To Reproduce

  • deploy a VM with context cdrom of type block
  • try to reconfigure the VM (update configuration).
Fri Aug 9 10:32:55 2024 [Z0][VMM][I]: Command execution fail (exit code: 1): cat << 'EOT' | /var/tmp/one/vmm/kvm/reconfigure '73b45748-1863-4d19-95ab-42144817190a' 'hda' '/var/lib/one//datastores/0/0/disk.1' 0 u24onekvm2
Fri Aug 9 10:32:55 2024 [Z0][VMM][E]: reconfigure: Command "virsh --connect qemu:///system change-media 73b45748-1863-4d19-95ab-42144817190a hda /var/lib/one//datastores/0/0/disk.1 --insert" failed: error: Failed to complete action insert on media
Fri Aug 9 10:32:55 2024 [Z0][VMM][I]: error: internal error: unable to execute QEMU command 'blockdev-add': 'file' driver requires '/var/lib/one//datastores/0/0/disk.1' to be a regular file
Fri Aug 9 10:32:55 2024 [Z0][VMM][I]: Could not insert CDROM /var/lib/one//datastores/0/0/disk.1 to hda
Fri Aug 9 10:32:55 2024 [Z0][VMM][I]: ExitCode: 1
Fri Aug 9 10:32:55 2024 [Z0][VMM][I]: Failed to execute virtualization driver operation: reconfigure.
Fri Aug 9 10:32:55 2024 [Z0][VMM][E]: UPDATECONF: ERROR: reconfigure: Command "virsh --connect qemu:///system change-media 73b45748-1863-4d19-95ab-42144817190a hda /var/lib/one//datastores/0/0/disk.1 --insert" failed: error: Failed to complete action insert on media error: internal error: unable to execute QEMU command 'blockdev-add': 'file' driver requires '/var/lib/one//datastores/0/0/disk.1' to be a regular file Could not insert CDROM /var/lib/one//datastores/0/0/disk.1 to hda ExitCode: 1

Expected behavior
VM reconfigure should succeed.

Details

  • Affected Component: [e.g. Sunstone, Scheduler, or Storage]
  • Hypervisor: [e.g. KVM]
  • Version: [e.g. 5.4.12 or development]

Additional context
from virsh change-media help

virsh # help change-media
  NAME
    change-media - Change media of CD or floppy drive

  SYNOPSIS
    change-media <domain> <path> [--source <string>] [--eject] [--insert] [--update] [--current] [--live] [--config] [--force] [--print-xml] [--block]

  DESCRIPTION
    Change media of CD or floppy drive.

  OPTIONS
    [--domain] <string>  domain name, id or uuid
    [--path] <string>  Fully-qualified path or target of disk device
    --source <string>  source of the media
    --eject          Eject the media
    --insert         Insert the media
    --update         Update the media
    --current        can be either or both of --live and --config, depends on implementation hypervisor driver
    --live           alter live configuration of running domain
    --config         alter persistent configuration, effect observed on next boot
    --force          force media changing
    --print-xml      print XML document rather than change media
    --block          source media is a block device

it should be relatively easy to fix in the bash script by testing the $ISO_PATH argument and appending --block if it is recognized as a block device.

Progress Status

  • Code committed
  • Testing - QA
  • Documentation (Release notes - resolved issues, compatibility, known issues)
atodorov-storpool added a commit to atodorov-storpool/one that referenced this issue Aug 9, 2024
@rsmontero rsmontero added this to the Release 6.10.1 milestone Aug 9, 2024
rsmontero pushed a commit that referenced this issue Oct 11, 2024
when the $ISO_PATH is a block device

(cherry picked from commit bf43d43)
rsmontero added a commit to OpenNebula/docs that referenced this issue Oct 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants