xen-4.9.0 and cdrom block-attach/-detach

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

xen-4.9.0 and cdrom block-attach/-detach

squidmobile
22 oct 2017

greetings [hidden email],

i ran into a problem adding and removing cdrom images from a
xen-4.9.0 vm.  i put a series of commands into a shell script, ran
a script command, and captured the output from ksh -xv.

i figure these errors propagate through to the vm so that it sees
neither the disk removal nor the new disk attachment.

i noticed the cdrom did NOT add a .../script = entry similar to the
disk test, so i ran an experiment and manually added a similar
xenstore entry.  however, the block-detach commmand failed as
before.

any comments or suggestions?

thanks.
frank smith


Script started on Sun 22 Oct 2017 11:01:57 AM EDT
xanadu(root) 1 $
xanadu(root) 1 $
xanadu(root) 1 $ ksh -xv /tmp/gigo

xl block-list <vm-name>


+ xl block-list <vm-name>
Vdev  BE  handle state evt-ch ring-ref BE-path
51712 0   102    1     -1     -1       /local/domain/0/backend/vbd/102/51712
51728 0   102    1     -1     -1       /local/domain/0/backend/vbd/102/51728
xenstore-ls -f | grep '/102/'


+ grep /102/
+ xenstore-ls -f
/local/domain/0/device-model/102/backends = ""
/local/domain/0/device-model/102/backends/console = ""
/local/domain/0/device-model/102/backends/vkbd = ""
/local/domain/0/device-model/102/backends/qdisk = ""
/local/domain/0/device-model/102/backends/qusb = ""
/local/domain/0/device-model/102/state = "running"
/local/domain/0/device-model/102/physmap = ""
/local/domain/0/device-model/102/physmap/1f000000 = ""
/local/domain/0/device-model/102/physmap/1f000000/start_addr = "f1000000"
/local/domain/0/device-model/102/physmap/1f000000/size = "1000000"
/local/domain/0/device-model/102/physmap/1f000000/name = "vga.vram"
/local/domain/0/backend/vbd/102/51712 = ""
/local/domain/0/backend/vbd/102/51712/frontend = "/local/domain/102/device/vbd/51712"
/local/domain/0/backend/vbd/102/51712/params = "/dev/vg_xen/xen_<vm-name>_c"
/local/domain/0/backend/vbd/102/51712/script = "/etc/xen/scripts/block"
/local/domain/0/backend/vbd/102/51712/frontend-id = "102"
/local/domain/0/backend/vbd/102/51712/online = "1"
/local/domain/0/backend/vbd/102/51712/removable = "0"
/local/domain/0/backend/vbd/102/51712/bootable = "1"
/local/domain/0/backend/vbd/102/51712/state = "2"
/local/domain/0/backend/vbd/102/51712/dev = "xvda"
/local/domain/0/backend/vbd/102/51712/type = "phy"
/local/domain/0/backend/vbd/102/51712/mode = "w"
/local/domain/0/backend/vbd/102/51712/device-type = "disk"
/local/domain/0/backend/vbd/102/51712/discard-enable = "1"
/local/domain/0/backend/vbd/102/51712/max-ring-page-order = "4"
/local/domain/0/backend/vbd/102/51712/physical-device = "fa:b"
/local/domain/0/backend/vbd/102/51712/physical-device-path = "/dev/dm-11"
/local/domain/0/backend/vbd/102/51712/hotplug-status = "connected"
/local/domain/0/backend/vbd/102/51728 = ""
/local/domain/0/backend/vbd/102/51728/frontend = "/local/domain/102/device/vbd/51728"
/local/domain/0/backend/vbd/102/51728/params = "/scratch01/gigo.d1/test.xen/<vm-name>.d"
/local/domain/0/backend/vbd/102/51728/script = "/etc/xen/scripts/block"
/local/domain/0/backend/vbd/102/51728/frontend-id = "102"
/local/domain/0/backend/vbd/102/51728/online = "1"
/local/domain/0/backend/vbd/102/51728/removable = "0"
/local/domain/0/backend/vbd/102/51728/bootable = "1"
/local/domain/0/backend/vbd/102/51728/state = "2"
/local/domain/0/backend/vbd/102/51728/dev = "xvdb"
/local/domain/0/backend/vbd/102/51728/type = "phy"
/local/domain/0/backend/vbd/102/51728/mode = "w"
/local/domain/0/backend/vbd/102/51728/device-type = "disk"
/local/domain/0/backend/vbd/102/51728/discard-enable = "1"
/local/domain/0/backend/vbd/102/51728/max-ring-page-order = "4"
/local/domain/0/backend/vbd/102/51728/node = "/dev/loop1"
/local/domain/0/backend/vbd/102/51728/physical-device = "7:1"
/local/domain/0/backend/vbd/102/51728/physical-device-path = "/dev/loop1"
/local/domain/0/backend/vbd/102/51728/hotplug-status = "connected"
/local/domain/0/backend/vkbd/102/0 = ""
/local/domain/0/backend/vkbd/102/0/frontend = "/local/domain/102/device/vkbd/0"
/local/domain/0/backend/vkbd/102/0/frontend-id = "102"
/local/domain/0/backend/vkbd/102/0/online = "1"
/local/domain/0/backend/vkbd/102/0/state = "2"
/local/domain/0/backend/vkbd/102/0/feature-abs-pointer = "1"
/local/domain/0/backend/vkbd/102/0/hotplug-status = "connected"
/local/domain/0/backend/console/102/0 = ""
/local/domain/0/backend/console/102/0/frontend = "/local/domain/102/console"
/local/domain/0/backend/console/102/0/frontend-id = "102"
/local/domain/0/backend/console/102/0/online = "1"
/local/domain/0/backend/console/102/0/state = "1"
/local/domain/0/backend/console/102/0/protocol = "vt100"
/local/domain/102/vm = "/vm/2f2e978c-f17e-4353-a0c7-ec3022c62ba3"
/local/domain/102/name = "<vm-name>"
/local/domain/102/cpu = ""
/local/domain/102/cpu/0 = ""
/local/domain/102/cpu/0/availability = "online"
/local/domain/102/memory = ""
/local/domain/102/memory/static-max = "524288"
/local/domain/102/memory/target = "507904"
/local/domain/102/memory/videoram = "16384"
/local/domain/102/device = ""
/local/domain/102/device/suspend = ""
/local/domain/102/device/suspend/event-channel = ""
/local/domain/102/device/vbd = ""
/local/domain/102/device/vbd/51712 = ""
/local/domain/102/device/vbd/51712/backend = "/local/domain/0/backend/vbd/102/51712"
/local/domain/102/device/vbd/51712/backend-id = "0"
/local/domain/102/device/vbd/51712/state = "1"
/local/domain/102/device/vbd/51712/virtual-device = "51712"
/local/domain/102/device/vbd/51712/device-type = "disk"
/local/domain/102/device/vbd/51728 = ""
/local/domain/102/device/vbd/51728/backend = "/local/domain/0/backend/vbd/102/51728"
/local/domain/102/device/vbd/51728/backend-id = "0"
/local/domain/102/device/vbd/51728/state = "1"
/local/domain/102/device/vbd/51728/virtual-device = "51728"
/local/domain/102/device/vbd/51728/device-type = "disk"
/local/domain/102/device/vkbd = ""
/local/domain/102/device/vkbd/0 = ""
/local/domain/102/device/vkbd/0/backend = "/local/domain/0/backend/vkbd/102/0"
/local/domain/102/device/vkbd/0/backend-id = "0"
/local/domain/102/device/vkbd/0/state = "1"
/local/domain/102/control = ""
/local/domain/102/control/shutdown = ""
/local/domain/102/control/feature-poweroff = ""
/local/domain/102/control/feature-reboot = ""
/local/domain/102/control/feature-suspend = ""
/local/domain/102/control/feature-s3 = ""
/local/domain/102/control/feature-s4 = ""
/local/domain/102/control/platform-feature-multiprocessor-suspend = "1"
/local/domain/102/control/platform-feature-xs_reset_watches = "1"
/local/domain/102/hvmloader = ""
/local/domain/102/hvmloader/bios = "seabios"
/local/domain/102/hvmloader/allow-memory-relocate = "0"
/local/domain/102/data = ""
/local/domain/102/drivers = ""
/local/domain/102/feature = ""
/local/domain/102/attr = ""
/local/domain/102/domid = "102"
/local/domain/102/store = ""
/local/domain/102/store/port = "1"
/local/domain/102/store/ring-ref = "1044476"
/local/domain/102/platform = ""
/local/domain/102/platform/acpi = "1"
/local/domain/102/platform/acpi_s3 = "0"
/local/domain/102/platform/acpi_s4 = "0"
/local/domain/102/platform/acpi_laptop_slate = "0"
/local/domain/102/console = ""
/local/domain/102/console/backend = "/local/domain/0/backend/console/102/0"
/local/domain/102/console/backend-id = "0"
/local/domain/102/console/limit = "1048576"
/local/domain/102/console/type = "xenconsoled"
/local/domain/102/console/output = "pty"
/local/domain/102/console/tty = "/dev/pts/45"
/local/domain/102/console/port = "2"
/local/domain/102/console/ring-ref = "1044479"
/local/domain/102/image = ""
/local/domain/102/image/device-model-pid = "23647"
/libxl/102/device = ""
/libxl/102/device/vbd = ""
/libxl/102/device/vbd/51712 = ""
/libxl/102/device/vbd/51712/frontend = "/local/domain/102/device/vbd/51712"
/libxl/102/device/vbd/51712/backend = "/local/domain/0/backend/vbd/102/51712"
/libxl/102/device/vbd/51712/params = "/dev/vg_xen/xen_<vm-name>_c"
/libxl/102/device/vbd/51712/script = "/etc/xen/scripts/block"
/libxl/102/device/vbd/51712/frontend-id = "102"
/libxl/102/device/vbd/51712/online = "1"
/libxl/102/device/vbd/51712/removable = "0"
/libxl/102/device/vbd/51712/bootable = "1"
/libxl/102/device/vbd/51712/state = "1"
/libxl/102/device/vbd/51712/dev = "xvda"
/libxl/102/device/vbd/51712/type = "phy"
/libxl/102/device/vbd/51712/mode = "w"
/libxl/102/device/vbd/51712/device-type = "disk"
/libxl/102/device/vbd/51712/discard-enable = "1"
/libxl/102/device/vbd/51728 = ""
/libxl/102/device/vbd/51728/frontend = "/local/domain/102/device/vbd/51728"
/libxl/102/device/vbd/51728/backend = "/local/domain/0/backend/vbd/102/51728"
/libxl/102/device/vbd/51728/params = "/scratch01/gigo.d1/test.xen/<vm-name>.d"
/libxl/102/device/vbd/51728/script = "/etc/xen/scripts/block"
/libxl/102/device/vbd/51728/frontend-id = "102"
/libxl/102/device/vbd/51728/online = "1"
/libxl/102/device/vbd/51728/removable = "0"
/libxl/102/device/vbd/51728/bootable = "1"
/libxl/102/device/vbd/51728/state = "1"
/libxl/102/device/vbd/51728/dev = "xvdb"
/libxl/102/device/vbd/51728/type = "phy"
/libxl/102/device/vbd/51728/mode = "w"
/libxl/102/device/vbd/51728/device-type = "disk"
/libxl/102/device/vbd/51728/discard-enable = "1"
/libxl/102/device/console = ""
/libxl/102/device/console/0 = ""
/libxl/102/device/console/0/frontend = "/local/domain/102/console"
/libxl/102/device/console/0/backend = "/local/domain/0/backend/console/102/0"
/libxl/102/device/console/0/frontend-id = "102"
/libxl/102/device/console/0/online = "1"
/libxl/102/device/console/0/state = "1"
/libxl/102/device/console/0/protocol = "vt100"
/libxl/102/device/vkbd = ""
/libxl/102/device/vkbd/0 = ""
/libxl/102/device/vkbd/0/frontend = "/local/domain/102/device/vkbd/0"
/libxl/102/device/vkbd/0/backend = "/local/domain/0/backend/vkbd/102/0"
/libxl/102/device/vkbd/0/frontend-id = "102"
/libxl/102/device/vkbd/0/online = "1"
/libxl/102/device/vkbd/0/state = "1"
/libxl/102/dm-version = "qemu_xen"
xl block-attach <vm-name> /tmp/gigo.iso,raw,hdd


+ xl block-attach <vm-name> /tmp/gigo.iso,raw,hdd
xl block-list <vm-name>


+ xl block-list <vm-name>
Vdev  BE  handle state evt-ch ring-ref BE-path
51712 0   102    1     -1     -1       /local/domain/0/backend/vbd/102/51712
51728 0   102    1     -1     -1       /local/domain/0/backend/vbd/102/51728
5696  0   102    1     -1     -1       /local/domain/0/backend/vbd/102/5696
xenstore-ls -f | grep '/102/' | grep '/5696'


+ grep /5696
+ xenstore-ls -f
+ grep /102/
/local/domain/0/backend/vbd/102/5696 = ""
/local/domain/0/backend/vbd/102/5696/frontend = "/local/domain/102/device/vbd/5696"
/local/domain/0/backend/vbd/102/5696/params = "/tmp/gigo.iso"
/local/domain/0/backend/vbd/102/5696/script = "/etc/xen/scripts/block"
/local/domain/0/backend/vbd/102/5696/frontend-id = "102"
/local/domain/0/backend/vbd/102/5696/online = "1"
/local/domain/0/backend/vbd/102/5696/removable = "0"
/local/domain/0/backend/vbd/102/5696/bootable = "1"
/local/domain/0/backend/vbd/102/5696/state = "2"
/local/domain/0/backend/vbd/102/5696/dev = "hdd"
/local/domain/0/backend/vbd/102/5696/type = "phy"
/local/domain/0/backend/vbd/102/5696/mode = "w"
/local/domain/0/backend/vbd/102/5696/device-type = "disk"
/local/domain/0/backend/vbd/102/5696/discard-enable = "1"
/local/domain/0/backend/vbd/102/5696/max-ring-page-order = "4"
/local/domain/0/backend/vbd/102/5696/node = "/dev/loop2"
/local/domain/0/backend/vbd/102/5696/physical-device = "7:2"
/local/domain/0/backend/vbd/102/5696/physical-device-path = "/dev/loop2"
/local/domain/0/backend/vbd/102/5696/hotplug-status = "connected"
/local/domain/102/device/vbd/5696 = ""
/local/domain/102/device/vbd/5696/backend = "/local/domain/0/backend/vbd/102/5696"
/local/domain/102/device/vbd/5696/backend-id = "0"
/local/domain/102/device/vbd/5696/state = "1"
/local/domain/102/device/vbd/5696/virtual-device = "5696"
/local/domain/102/device/vbd/5696/device-type = "disk"
/libxl/102/device/vbd/5696 = ""
/libxl/102/device/vbd/5696/frontend = "/local/domain/102/device/vbd/5696"
/libxl/102/device/vbd/5696/backend = "/local/domain/0/backend/vbd/102/5696"
/libxl/102/device/vbd/5696/params = "/tmp/gigo.iso"
/libxl/102/device/vbd/5696/script = "/etc/xen/scripts/block"
/libxl/102/device/vbd/5696/frontend-id = "102"
/libxl/102/device/vbd/5696/online = "1"
/libxl/102/device/vbd/5696/removable = "0"
/libxl/102/device/vbd/5696/bootable = "1"
/libxl/102/device/vbd/5696/state = "1"
/libxl/102/device/vbd/5696/dev = "hdd"
/libxl/102/device/vbd/5696/type = "phy"
/libxl/102/device/vbd/5696/mode = "w"
/libxl/102/device/vbd/5696/device-type = "disk"
/libxl/102/device/vbd/5696/discard-enable = "1"
xl block-detach <vm-name> hdd


+ xl block-detach <vm-name> hdd
xl block-list <vm-name>


+ xl block-list <vm-name>
Vdev  BE  handle state evt-ch ring-ref BE-path
51712 0   102    1     -1     -1       /local/domain/0/backend/vbd/102/51712
51728 0   102    1     -1     -1       /local/domain/0/backend/vbd/102/51728
xenstore-ls -f | grep '/102/' | grep '/5696'


+ grep /5696
+ xenstore-ls -f
+ grep /102/
xl block-attach <vm-name> /tmp/gigo.iso,raw,hdd,ro,cdrom


+ xl block-attach <vm-name> /tmp/gigo.iso,raw,hdd,ro,cdrom
xl block-list <vm-name>


+ xl block-list <vm-name>
Vdev  BE  handle state evt-ch ring-ref BE-path
51712 0   102    1     -1     -1       /local/domain/0/backend/vbd/102/51712
51728 0   102    1     -1     -1       /local/domain/0/backend/vbd/102/51728
5696  0   102    1     -1     -1       /local/domain/0/backend/qdisk/102/5696
xenstore-ls -f | grep '/102/' | grep '/5696'


+ xenstore-ls -f
+ grep /5696
+ grep /102/
/local/domain/0/backend/qdisk/102/5696 = ""
/local/domain/0/backend/qdisk/102/5696/frontend = "/local/domain/102/device/vbd/5696"
/local/domain/0/backend/qdisk/102/5696/params = "aio:/tmp/gigo.iso"
/local/domain/0/backend/qdisk/102/5696/frontend-id = "102"
/local/domain/0/backend/qdisk/102/5696/online = "1"
/local/domain/0/backend/qdisk/102/5696/removable = "1"
/local/domain/0/backend/qdisk/102/5696/bootable = "1"
/local/domain/0/backend/qdisk/102/5696/state = "2"
/local/domain/0/backend/qdisk/102/5696/dev = "hdd"
/local/domain/0/backend/qdisk/102/5696/type = "qdisk"
/local/domain/0/backend/qdisk/102/5696/mode = "r"
/local/domain/0/backend/qdisk/102/5696/device-type = "cdrom"
/local/domain/0/backend/qdisk/102/5696/discard-enable = "0"
/local/domain/0/backend/qdisk/102/5696/feature-flush-cache = "1"
/local/domain/0/backend/qdisk/102/5696/feature-persistent = "1"
/local/domain/0/backend/qdisk/102/5696/info = "5"
/local/domain/0/backend/qdisk/102/5696/hotplug-status = "connected"
/local/domain/102/device/vbd/5696 = ""
/local/domain/102/device/vbd/5696/backend = "/local/domain/0/backend/qdisk/102/5696"
/local/domain/102/device/vbd/5696/backend-id = "0"
/local/domain/102/device/vbd/5696/state = "1"
/local/domain/102/device/vbd/5696/virtual-device = "5696"
/local/domain/102/device/vbd/5696/device-type = "cdrom"
/libxl/102/device/vbd/5696 = ""
/libxl/102/device/vbd/5696/frontend = "/local/domain/102/device/vbd/5696"
/libxl/102/device/vbd/5696/backend = "/local/domain/0/backend/qdisk/102/5696"
/libxl/102/device/vbd/5696/params = "aio:/tmp/gigo.iso"
/libxl/102/device/vbd/5696/frontend-id = "102"
/libxl/102/device/vbd/5696/online = "1"
/libxl/102/device/vbd/5696/removable = "1"
/libxl/102/device/vbd/5696/bootable = "1"
/libxl/102/device/vbd/5696/state = "1"
/libxl/102/device/vbd/5696/dev = "hdd"
/libxl/102/device/vbd/5696/type = "qdisk"
/libxl/102/device/vbd/5696/mode = "r"
/libxl/102/device/vbd/5696/device-type = "cdrom"
/libxl/102/device/vbd/5696/discard-enable = "0"
xl block-detach <vm-name> hdd


+ xl block-detach <vm-name> hdd
libxl: error: libxl_device.c:1075:device_backend_callback: Domain 102:unable to remove device with path /local/domain/0/backend/qdisk/102/5696
libxl: error: libxl_device.c:1375:device_addrm_aocomplete: Domain 102:Unable to remove vbd with id 5696
libxl_device_disk_remove failed.
xl block-list <vm-name>


+ xl block-list <vm-name>
Vdev  BE  handle state evt-ch ring-ref BE-path
51712 0   102    1     -1     -1       /local/domain/0/backend/vbd/102/51712
51728 0   102    1     -1     -1       /local/domain/0/backend/vbd/102/51728
xenstore-ls -f | grep '/102/' | grep '/5696'


+ xenstore-ls -f
+ grep /5696
+ grep /102/
xl block-attach <vm-name> /tmp/gigo.iso,raw,xvdd,ro,cdrom


+ xl block-attach <vm-name> /tmp/gigo.iso,raw,xvdd,ro,cdrom
xl block-list <vm-name>


+ xl block-list <vm-name>
Vdev  BE  handle state evt-ch ring-ref BE-path
51712 0   102    1     -1     -1       /local/domain/0/backend/vbd/102/51712
51728 0   102    1     -1     -1       /local/domain/0/backend/vbd/102/51728
51760 0   102    1     -1     -1       /local/domain/0/backend/qdisk/102/51760
xenstore-ls -f | grep '/102/' | grep '/51760'


+ grep /51760
+ xenstore-ls -f
+ grep /102/
/local/domain/0/backend/qdisk/102/51760 = ""
/local/domain/0/backend/qdisk/102/51760/frontend = "/local/domain/102/device/vbd/51760"
/local/domain/0/backend/qdisk/102/51760/params = "aio:/tmp/gigo.iso"
/local/domain/0/backend/qdisk/102/51760/frontend-id = "102"
/local/domain/0/backend/qdisk/102/51760/online = "1"
/local/domain/0/backend/qdisk/102/51760/removable = "1"
/local/domain/0/backend/qdisk/102/51760/bootable = "1"
/local/domain/0/backend/qdisk/102/51760/state = "2"
/local/domain/0/backend/qdisk/102/51760/dev = "xvdd"
/local/domain/0/backend/qdisk/102/51760/type = "qdisk"
/local/domain/0/backend/qdisk/102/51760/mode = "r"
/local/domain/0/backend/qdisk/102/51760/device-type = "cdrom"
/local/domain/0/backend/qdisk/102/51760/discard-enable = "0"
/local/domain/0/backend/qdisk/102/51760/feature-flush-cache = "1"
/local/domain/0/backend/qdisk/102/51760/feature-persistent = "1"
/local/domain/0/backend/qdisk/102/51760/info = "5"
/local/domain/0/backend/qdisk/102/51760/hotplug-status = "connected"
/local/domain/102/device/vbd/51760 = ""
/local/domain/102/device/vbd/51760/backend = "/local/domain/0/backend/qdisk/102/51760"
/local/domain/102/device/vbd/51760/backend-id = "0"
/local/domain/102/device/vbd/51760/state = "1"
/local/domain/102/device/vbd/51760/virtual-device = "51760"
/local/domain/102/device/vbd/51760/device-type = "cdrom"
/libxl/102/device/vbd/51760 = ""
/libxl/102/device/vbd/51760/frontend = "/local/domain/102/device/vbd/51760"
/libxl/102/device/vbd/51760/backend = "/local/domain/0/backend/qdisk/102/51760"
/libxl/102/device/vbd/51760/params = "aio:/tmp/gigo.iso"
/libxl/102/device/vbd/51760/frontend-id = "102"
/libxl/102/device/vbd/51760/online = "1"
/libxl/102/device/vbd/51760/removable = "1"
/libxl/102/device/vbd/51760/bootable = "1"
/libxl/102/device/vbd/51760/state = "1"
/libxl/102/device/vbd/51760/dev = "xvdd"
/libxl/102/device/vbd/51760/type = "qdisk"
/libxl/102/device/vbd/51760/mode = "r"
/libxl/102/device/vbd/51760/device-type = "cdrom"
/libxl/102/device/vbd/51760/discard-enable = "0"
xl block-detach <vm-name> xvdd


+ xl block-detach <vm-name> xvdd
libxl: error: libxl_device.c:1075:device_backend_callback: Domain 102:unable to remove device with path /local/domain/0/backend/qdisk/102/51760
libxl: error: libxl_device.c:1375:device_addrm_aocomplete: Domain 102:Unable to remove vbd with id 51760
libxl_device_disk_remove failed.
xl block-list <vm-name>


+ xl block-list <vm-name>
Vdev  BE  handle state evt-ch ring-ref BE-path
51712 0   102    1     -1     -1       /local/domain/0/backend/vbd/102/51712
51728 0   102    1     -1     -1       /local/domain/0/backend/vbd/102/51728
xenstore-ls -f | grep '/102/' | grep '/51760'

+ xenstore-ls -f
+ grep /51760
+ grep /102/
xanadu(root) 2 $

Script done on Sun 22 Oct 2017 11:02:58 AM EDT

_______________________________________________
Xen-users mailing list
[hidden email]
https://lists.xen.org/xen-users
Reply | Threaded
Open this post in threaded view
|

Re: xen-4.9.0 and cdrom block-attach/-detach

George Dunlap
On Fri, Oct 27, 2017 at 7:28 PM,  <[hidden email]> wrote:

> 22 oct 2017
>
> greetings [hidden email],
>
> i ran into a problem adding and removing cdrom images from a
> xen-4.9.0 vm.  i put a series of commands into a shell script, ran
> a script command, and captured the output from ksh -xv.
>
> i figure these errors propagate through to the vm so that it sees
> neither the disk removal nor the new disk attachment.
>
> i noticed the cdrom did NOT add a .../script = entry similar to the
> disk test, so i ran an experiment and manually added a similar
> xenstore entry.  however, the block-detach commmand failed as
> before.
>
> any comments or suggestions?

Why do you want to add hdd as a cdrom?

Could you add an empty cdrom to the domain config file, then use `xl
cd-insert` and `xl cd-eject` instead of block-attach and block-detach?

 -George

_______________________________________________
Xen-users mailing list
[hidden email]
https://lists.xen.org/xen-users
Reply | Threaded
Open this post in threaded view
|

Re: xen-4.9.0 and cdrom block-attach/-detach

squidmobile
In reply to this post by squidmobile
03 nov 2017

>> greetings [hidden email],
>>
>> i ran into a problem adding and removing cdrom images from a
>> xen-4.9.0 vm.  i put a series of commands into a shell script, ran
>> a script command, and captured the output from ksh -xv.
>>
>> i figure these errors propagate through to the vm so that it sees
>> neither the disk removal nor the new disk attachment.
:>
>> i noticed the cdrom did NOT add a .../script = entry similar to the
>> disk test, so i ran an experiment and manually added a similar
>> xenstore entry.  however, the block-detach commmand failed as
>> before.
>>
>> any comments or suggestions?

> Why do you want to add hdd as a cdrom?

i cloned the cdrom (iso9660) to a disk image.  for example, on
domain0:
  dd if=/dev/sr0 of=linux.iso bs=1k
  cmp   /dev/sr0    linux.iso
the block-attach requires some variant of:
  <file path>, raw, hdd,  ro, cdrom
  <file path>, raw, sdd,  ro, cdrom
  <file path>, raw, xvdd, ro, cdrom
i can then boot the vm from the cd image or install packages as
necessary.  i use variants of these commands to install linux into
my vm's.

i chose hdd/sdd/xvdd because i already attached two disks to the
ata bus.  i favor *d, because i prefer to put my disks on the ata
bus at locations 0-0 (hda/sda/xvda), 0-1 (*b), and maybe 1-0 (*c).
that leaves the last slot (1-1) for the cdrom.  in rare situations,
i sometimes attach a second cdrom at 1-0.

i used *d as a test to log the errors from the attach and detach
commands.  to me, the important part came from the error dialog.
WHY did the block-detach command fail for the cdrom image?  why did
it work when it thought it was a disk image?  what did xen expect
to happen that did not?  did i set something up wrong?  do i need
to adjust an out-of-the-box xen script?  what does it take to get
a clean eject of the vm's cdrom device?

from a guest os perspective, i'm not sure it makes much difference
between hdd and sdd.  however, it could make a great deal of
difference with xvdd, assuming the guest os ran pv instead of hvm.

> Could you add an empty cdrom to the domain config file, then use
> `xl cd-insert` and `xl cd-eject` instead of block-attach and
> block-detach?

i suppose it would have made a difference, had i known about the
xl cd-insert or cd-eject commands.  somehow, that one slid
completely by me.  checking on that is VERY definitely on my todo
list when i get home.

i've tried an empty cdrom using a line similar to this:
  , raw, hdd, ro, cdrom
with the block-detach/-attach commands, i usually have to detach
the empty cdrom device, attach the flat file, and reboot the vm.

oddly enough, the block-attach and -detach worked as expected for
a while a couple of years ago, but it failed both before and after
that short time window.  no idea why, although your cd-eject and
cd-insert commands might explain the recent observations.

thank you for your comments and suggestions.
frank smith
_______________________________________________
Xen-users mailing list
[hidden email]
https://lists.xen.org/xen-users