class AzureVolumeResourceBuilder extends AbstractAzureComputeBuilder {

    @Override
    public List<CloudResource> create(AzureContext context, long privateId, AuthenticatedContext auth, Group group, Image image) {
        LOGGER.info("Creating volume resources");
        List<CloudResource> computeResources = context.getComputeResources(privateId);
        if (Objects.isNull(computeResources) || computeResources.isEmpty()) {
            return null;
        }
        CloudResource vm = context.getComputeResources(privateId)
                .stream()
                .filter(cloudResource -> ResourceType.AZURE_INSTANCE.equals(cloudResource.getType()))
                .findFirst()
                .get();

        Optional<CloudResource> reattachableVolumeSet = computeResources.stream()
                .filter(resource -> ResourceType.AZURE_VOLUMESET.equals(resource.getType()))
                .filter(cloudResource -> CommonStatus.DETACHED.equals(cloudResource.getStatus()) || vm.getInstanceId().equals(cloudResource.getInstanceId()))
                .findFirst();
        LOGGER.debug("Reattachable volume set {}",
                reattachableVolumeSet.map(cloudResource -> "is present with name:" + cloudResource.getName())
                .orElse("is not present"));

        return List.of(reattachableVolumeSet.orElseGet(createVolumeSet(privateId, auth, group, vm,
                context.getStringParameter(PlatformParametersConsts.RESOURCE_CRN_PARAMETER))));
    }

}