'Test backup create using force flag.
Cinder allows to create a volume backup, whether the volume status
is "available" or "in-use".'

@decorators.idempotent_id('07af8f6d-80af-44c9-a5dc-c8427b1b62e6')
@test.services('compute')
def test_backup_create_attached_volume(self):

    volume = self.create_volume()
    self.addCleanup(self.volumes_client.delete_volume, volume['id'])
    server = self.create_server()
    self.attach_volume(server['id'], volume['id'])
    backup_name = data_utils.rand_name((self.__class__.__name__ + '-Backup'))
    backup = self.create_backup(volume_id=volume['id'], name=backup_name, force=True)
    self.assertEqual(backup_name, backup['name'])
