code: def detach_volume(self, volume):
          
          if hasattr(volume, "id"):
              volume_id = volume.id
          else:
              volume_id = volume
          return self.ec2.detach_volume(volume_id=volume_id, instance_id=self.instance_id)
docs: Detach an EBS volume from this server
  
          :param volume: EBS Volume to detach
          :type volume: boto.ec2.volume.Volume