)]}'
{"nova/virt/libvirt/volume.py":[{"author":{"_account_id":1779,"name":"Daniel Berrange","email":"berrange@redhat.com","username":"berrange"},"change_message_id":"b3d145e1d0a35f23dd76d54f663f89b7de228edb","unresolved":false,"context_lines":[{"line_number":1009,"context_line":"        \"\"\"Disconnect the volume.\"\"\""},{"line_number":1010,"context_line":"        smbfs_share \u003d connection_info[\u0027data\u0027][\u0027export\u0027]"},{"line_number":1011,"context_line":"        mount_path \u003d self._get_mount_path(connection_info)"},{"line_number":1012,"context_line":"        remotefs.unmount_share(mount_path, smbfs_share)"},{"line_number":1013,"context_line":""},{"line_number":1014,"context_line":"    def _parse_mount_options(self, connection_info):"},{"line_number":1015,"context_line":"        mount_options \u003d \" \".join("}],"source_content_type":"text/x-python","patch_set":1,"id":"3afb71cf_08a44eb7","line":1012,"updated":"2015-06-11 12:47:14.000000000","message":"Ok, so the root cause of the problem is this call here, which unconditionally attempts to unmount the share. This is implicitly relying on the fact that the QEMU process will have an open file descriptor for any volumes in use, thus causing the unmount of fail.\n\nAs you say, this has the obvious race condition because of the gap between connecting the volume and actually starting QEMU, or hotplugging it to QEMU.\n\nThis similar issue exists with iSCSI - one iSCSI target can serve up multiple LUNS for different VMs. That calls _get_all_block_devices() to see what LUNs are in use by running VMs, but that in fact has the same race as here, as we may have connected to iSCSI but not attached to the VM. So I wonder if we\u0027re getting failures due to that ever.  The NFS volume driver also shares this same problem - it is unconditionally unmounting the NFS share relying on running QEMU processes to prevent the unmount.  And glusterfs appears to have the same problem\n\nI\u0027m not a huge fan of the idea of mounting the same filesystem share multiple times, once for each file. I\u0027d like to see us figure out a more general solution that lets us fix all these volume drivers, not just the smbfs one.\n\nIIUC, Nova should have a record of all volumes that are in use for VMs on the host, regardless of whether QEMU is actually running yet. If we could get this list of volumes, it seems like we could do something intelligent to determine if the volume target is needed by multiple VMs, and so solve this for all the volume drivers in a sane manner.","commit_id":"f46754cbad4d3a9bf558d377c698b50de15161f3"},{"author":{"_account_id":8543,"name":"Lucian Petrut","email":"lpetrut@cloudbasesolutions.com","username":"plucian"},"change_message_id":"e3a1442397348fb3e2e65af8c6595c7f77576d22","unresolved":false,"context_lines":[{"line_number":1009,"context_line":"        \"\"\"Disconnect the volume.\"\"\""},{"line_number":1010,"context_line":"        smbfs_share \u003d connection_info[\u0027data\u0027][\u0027export\u0027]"},{"line_number":1011,"context_line":"        mount_path \u003d self._get_mount_path(connection_info)"},{"line_number":1012,"context_line":"        remotefs.unmount_share(mount_path, smbfs_share)"},{"line_number":1013,"context_line":""},{"line_number":1014,"context_line":"    def _parse_mount_options(self, connection_info):"},{"line_number":1015,"context_line":"        mount_options \u003d \" \".join("}],"source_content_type":"text/x-python","patch_set":1,"id":"3afb71cf_de85c559","line":1012,"in_reply_to":"3afb71cf_08a44eb7","updated":"2015-06-11 15:35:40.000000000","message":"I\u0027m sending a new patchset keeping track of the export usage. I\u0027ll put this at the SMB volume driver level for now. If others will agree w/ this implementation, we can easily move it up a level and use it for other volume drivers as well.","commit_id":"f46754cbad4d3a9bf558d377c698b50de15161f3"},{"author":{"_account_id":1779,"name":"Daniel Berrange","email":"berrange@redhat.com","username":"berrange"},"change_message_id":"9569ab4d1c267a8f07ff32b962cbe935b7e5e9a9","unresolved":false,"context_lines":[{"line_number":969,"context_line":"              self).__init__(connection, is_block_dev\u003dFalse)"},{"line_number":970,"context_line":"        self.username_regex \u003d re.compile("},{"line_number":971,"context_line":"            r\"(user(?:name)?)\u003d(?:[^ ,]+\\\\)?([^ ,]+)\")"},{"line_number":972,"context_line":"        self._export_usage \u003d collections.defaultdict(list)"},{"line_number":973,"context_line":""},{"line_number":974,"context_line":"    def _get_device_path(self, connection_info):"},{"line_number":975,"context_line":"        smbfs_share \u003d connection_info[\u0027data\u0027][\u0027export\u0027]"}],"source_content_type":"text/x-python","patch_set":2,"id":"1af86dd1_b889f3cc","line":972,"updated":"2015-06-12 08:58:41.000000000","message":"This doesn\u0027t fly - when nova is restarted you\u0027ll loose all this information. That\u0027s why I said we need to do this based on info nova already records in teh database about volume attachments","commit_id":"177e1b91c6faa51542a3e72457c3ee9c68c87653"},{"author":{"_account_id":8543,"name":"Lucian Petrut","email":"lpetrut@cloudbasesolutions.com","username":"plucian"},"change_message_id":"b992984aafbbc04d8e7d4355ab70c46ca09deb7f","unresolved":false,"context_lines":[{"line_number":969,"context_line":"              self).__init__(connection, is_block_dev\u003dFalse)"},{"line_number":970,"context_line":"        self.username_regex \u003d re.compile("},{"line_number":971,"context_line":"            r\"(user(?:name)?)\u003d(?:[^ ,]+\\\\)?([^ ,]+)\")"},{"line_number":972,"context_line":"        self._export_usage \u003d collections.defaultdict(list)"},{"line_number":973,"context_line":""},{"line_number":974,"context_line":"    def _get_device_path(self, connection_info):"},{"line_number":975,"context_line":"        smbfs_share \u003d connection_info[\u0027data\u0027][\u0027export\u0027]"}],"source_content_type":"text/x-python","patch_set":2,"id":"1af86dd1_5be4393a","line":972,"in_reply_to":"1af86dd1_b889f3cc","updated":"2015-06-12 09:13:33.000000000","message":"Well, in this case we don\u0027t actually care if nova is restarted. Pending volume attachments will fail, and those which succeeded will have locks in place.\n\nIt would\u0027ve been easier if the block device mapping table had a couple more fields so that we could have better queries, retrieving mappings based on volume backend or target.","commit_id":"177e1b91c6faa51542a3e72457c3ee9c68c87653"}],"nova/virt/libvirt/volume/smbfs.py":[{"author":{"_account_id":8213,"name":"Claudiu Belu","email":"cbelu@cloudbasesolutions.com","username":"claudiub"},"change_message_id":"f772258b87a1da71d9b5ff870bcab04128347162","unresolved":false,"context_lines":[{"line_number":116,"context_line":"        return mount_options.strip(\", \").split(\u0027 \u0027)"},{"line_number":117,"context_line":""},{"line_number":118,"context_line":"    @export_synchronized"},{"line_number":119,"context_line":"    def _update_export_usage(self, export, resource, connected\u003dTrue):"},{"line_number":120,"context_line":"        if connected:"},{"line_number":121,"context_line":"            self._export_usage[export].append(resource)"},{"line_number":122,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":3,"id":"da85f559_e7ff5da8","line":119,"updated":"2015-11-10 12:09:59.000000000","message":"this is already covered by the existent tests, but 2 explicit unit tests would be nice, one per each branch.","commit_id":"59aa0141e8426284c2e602f6293ea6099a54a569"}]}
