Bugzilla – Bug 6968
mount-alter.sh breaks when sent a partition (rather than disk image) task
Last modified: 2010-04-06 14:35:09
You need to log in before you can comment on or make changes to this bug.
When using workspace control 2.3 with a customization task and using a partition for the disk, rather than a hard disk image (with multiple partitions), mount-alter.sh crashes. I think this is because the hard disk partitions have an offset parameter, and partitions do not, but the code assumes there will always be this sixth parameter. I have a hacky patch on github at: http://github.com/oldpatricka/nimbus/commit/a4b265d1b5ece5b55a4b2858f94fb24547a63d6a I'm sure there's a better way to fix this (maybe by moving the assignment into the HDONE subcommand), but it should illustrate the problem. Full output from a typical run in with this problem: "http://example1/sl53" state change: Propagated --> Corrupted Problem with http://example1/sl53: Problem with workspace driver, error executing request operation (but validation succeeded) STDERR: libvir: Xen error : Domain not found: xenUnifiedDomainLookupByName 2010-02-17 11:53:36,913 - ERROR - problem running command: '/usr/bin/sudo /opt/workspace/libexec/workspace-control/mount-alter.sh one /vm/secureimages/wrksp-100/canfarbase_i386.img /opt/workspace/var/workspace-control/mnt/wrksp-100 /opt/workspace/var/workspace-control/tmp/74cd2d68-b53b-4571-b596 /tmp/custom' ::: return code: 256 ::: output: /opt/workspace/libexec/workspace-control/mount-alter.sh received these arguments: - subcommand: one - imagefile: /vm/secureimages/wrksp-100/canfarbase_i386.img - mountpoint: /opt/workspace/var/workspace-control/mnt/wrksp-100 /opt/workspace/libexec/workspace-control/mount-alter.sh: line 134: $6: unbound variable 2010-02-17 11:53:36,945 - ERROR - problem running command: '/usr/bin/sudo /opt/workspace/libexec/workspace-control/mount-alter.sh one /vm/secureimages/wrksp-100/canfarbase_i386.img /opt/workspace/var/workspace-control/mnt/wrksp-100 /opt/workspace/var/workspace-control/tmp/74cd2d68-b53b-4571-b596 /tmp/custom' ::: return code: 256 ::: output: /opt/workspace/libexec/workspace-control/mount-alter.sh received these arguments: - subcommand: one - imagefile: /vm/secureimages/wrksp-100/canfarbase_i386.img - mountpoint: /opt/workspace/var/workspace-control/mnt/wrksp-100 /opt/workspace/libexec/workspace-control/mount-alter.sh: line 134: $6: unbound variable Traceback (most recent call last): File "/opt/workspace/src/python/workspacecontrol/main/wc_core.py", line 78, in core _core(vm_name, action, p, c) File "/opt/workspace/src/python/workspacecontrol/main/wc_core.py", line 167, in _core wc_core_creation.create(vm_name, p, c, async, editing, images, kernels, localnet, netbootstrap, netlease, netsecurity, persistence, platform) File "/opt/workspace/src/python/workspacecontrol/main/wc_core_creation.py", line 15, in create _create_local(vm_name, p, c, async, editing, images, kernels, localnet, netbootstrap, netlease, netsecurity, persistence, platform) File "/opt/workspace/src/python/workspacecontrol/main/wc_core_creation.py", line 27, in _create_local _common(local_file_set, vm_name, p, c, editing, kernels, localnet, netbootstrap, netlease, netsecurity, persistence, platform) File "/opt/workspace/src/python/workspacecontrol/main/wc_core_creation.py", line 50, in _common editing.process_after_procurement(local_file_set) File "/opt/workspace/src/python/workspacecontrol/defaults/ImageEditing.py", line 250, in process_after_procurement self._doMountCopyTasks(rootdisk, vm_name, mnttask_list, hdimage) File "/opt/workspace/src/python/workspacecontrol/defaults/ImageEditing.py", line 407, in _doMountCopyTasks self._doOneMountCopyTask(imagepath, src, task[1], mntpath, hdimage) File "/opt/workspace/src/python/workspacecontrol/defaults/ImageEditing.py", line 434, in _doOneMountCopyTask raise IncompatibleEnvironment(errmsg) IncompatibleEnvironment: problem running command: '/usr/bin/sudo /opt/workspace/libexec/workspace-control/mount-alter.sh one /vm/secureimages/wrksp-100/canfarbase_i386.img /opt/workspace/var/workspace-control/mnt/wrksp-100 /opt/workspace/var/workspace-control/tmp/74cd2d68-b53b-4571-b596 /tmp/custom' ::: return code: 256 ::: output: /opt/workspace/libexec/workspace-control/mount-alter.sh received these arguments: - subcommand: one - imagefile: /vm/secureimages/wrksp-100/canfarbase_i386.img - mountpoint: /opt/workspace/var/workspace-control/mnt/wrksp-100 /opt/workspace/libexec/workspace-control/mount-alter.sh: line 134: $6: unbound variable Problem with environment: problem running command: '/usr/bin/sudo /opt/workspace/libexec/workspace-control/mount-alter.sh one /vm/secureimages/wrksp-100/canfarbase_i386.img /opt/workspace/var/workspace-control/mnt/wrksp-100 /opt/workspace/var/workspace-control/tmp/74cd2d68-b53b-4571-b596 /tmp/custom' ::: return code: 256 ::: output: /opt/workspace/libexec/workspace-control/mount-alter.sh received these arguments: - subcommand: one - imagefile: /vm/secureimages/wrksp-100/canfarbase_i386.img - mountpoint: /opt/workspace/var/workspace-control/mnt/wrksp-100 /opt/workspace/libexec/workspace-control/mount-alter.sh: line 134: $6: unbound variable Exiting with error code: 3 "http://example1/sl53": Corrupted, calling destroy for you. "http://example1/sl53" was terminated.
That's unfortunate this slipped in without regression testing. Your patch looks fine to me, agree that it's a problem and agree that moving assignment to the HDONE block might be cleaner. Thanks Patrick.
Committed to master for Nimbus 2.4 http://github.com/nimbusproject/nimbus/commit/575bf830b64efcddcd000800a66a53646d922f47