'Detach a volume to a node.
:param volume: The ID of the volume
:type volume: :class:`StorageVolume`
:param ex_node: Node to detach from (optionnal if volume is attached
to only one node)
:type ex_node: :class:`Node`
:return: True or False representing operation successful
:rtype:   ``bool``
:raises: Exception: If ``ex_node`` is not provided and more than one
node is attached to the volume'

def detach_volume(self, volume, ex_node=None):

    action = self._get_project_action(('volume/%s/detach' % volume.id))
    if (ex_node is None):
        if (len(volume.extra['attachedTo']) != 1):
            err_msg = "Volume    '%s'    has    more    or    less    than    one    attachednodes,    you    must    specify    one."
            raise Exception(err_msg)
        ex_node = self.ex_get_node(volume.extra['attachedTo'][0])
    data = {'instanceId': ex_node.id}
    self.connection.request(action, data=data, method='POST')
    return True
