Ejemplo n.º 1
0
def check_volumes_mounted(vm_list):
    """
    Return error_info if any vm in @param vm_list have docker volume mounted
    """
    for vm_id, _ in vm_list:
        vm = vmdk_ops.findVmByUuid(vm_id)
        if vm:
            for d in vm.config.hardware.device:
                if find_dvs_volume(d):
                    error_info = generate_error_info(
                        ErrorCode.VM_WITH_MOUNTED_VOLUMES, vm.config.name)
                    return error_info
        else:
            error_info = generate_error_info(ErrorCode.VM_NOT_FOUND, vm_id)
            return error_info
    return None
Ejemplo n.º 2
0
def check_volumes_mounted(vm_list):
    """
    Return error_info if any vm in @param vm_list have docker volume mounted
    """
    for vm_id, _ in vm_list:
        vm = vmdk_ops.findVmByUuid(vm_id)
        if vm:
            for d in vm.config.hardware.device:
                if find_dvs_volume(d):
                    error_info = generate_error_info(ErrorCode.VM_WITH_MOUNTED_VOLUMES,
                                                     vm.config.name)
                    return error_info
        else:
            error_info = generate_error_info(ErrorCode.VM_NOT_FOUND, vm_id)
            return error_info
    return None