Skip to content

Commit

Permalink
Merge pull request #1423 from TimothyAsirJeyasing/bluestore-migration…
Browse files Browse the repository at this point in the history
…-epic-5722

Update activity card for bluestore-rdr to bluestore migration
  • Loading branch information
openshift-merge-bot[bot] authored Jul 16, 2024
2 parents 24059fb + 169298e commit 8870314
Show file tree
Hide file tree
Showing 30 changed files with 176 additions and 905 deletions.
1 change: 0 additions & 1 deletion cypress/support.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ Cypress.Commands.add('install', () => {
cy.get('table').get('input[type="checkbox"]').first().check();
cy.get('button').contains('Next').click();
cy.get('button').contains('Next').click();
cy.get('button').contains('Next').click();
cy.get('button')
.contains('Create StorageSystem')
.as('Create StorageSystem Button');
Expand Down
19 changes: 2 additions & 17 deletions locales/en/plugin__odf-console.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@
"We could not retrieve any information about the managed cluster {{names}}. Check the documentation for potential causes and follow the steps mentioned and try again.": "We could not retrieve any information about the managed cluster {{names}}. Check the documentation for potential causes and follow the steps mentioned and try again.",
"{{ names }} has either an unsupported Data Foundation version or the Data Foundation operator is missing, install or update to Data Foundation {{ version }} or the latest version to enable DR protection.": "{{ names }} has either an unsupported Data Foundation version or the Data Foundation operator is missing, install or update to Data Foundation {{ version }} or the latest version to enable DR protection.",
"{{ names }} is not connected to RHCS": "{{ names }} is not connected to RHCS",
"Cluster not pre-configured for Regional-DR": "Cluster not pre-configured for Regional-DR",
"The selected cluster(s)[{{clusters}}] is not configured for Regional-DR setup. Migrate the OSDs to optimise the cluster for disaster recovery services.": "The selected cluster(s)[{{clusters}}] is not configured for Regional-DR setup. Migrate the OSDs to optimise the cluster for disaster recovery services.",
"Sync schedule": "Sync schedule",
"Replication policy": "Replication policy",
"Information unavailable": "Information unavailable",
Expand Down Expand Up @@ -555,6 +553,8 @@
"Used capacity": "Used capacity",
"Requested capacity": "Requested capacity",
"Expanding StorageCluster": "Expanding StorageCluster",
"Migrating cluster OSDs": "Migrating cluster OSDs",
"{{blueStoreCount}}/{{totalOSDCount}} OSDs migrated:": "{{blueStoreCount}}/{{totalOSDCount}} OSDs migrated:",
"Upgrading Data Foundation's Operator": "Upgrading Data Foundation's Operator",
"Select a namespace:": "Select a namespace:",
"Only showing PVCs that are being mounted on an active pod": "Only showing PVCs that are being mounted on an active pod",
Expand All @@ -568,14 +568,7 @@
"Estimated days until full": "Estimated days until full",
"number of days left": "number of days left",
"Internal": "Internal",
"Disaster recovery readiness": "Disaster recovery readiness",
"Raw capacity is the absolute total disk space available to the array subsystem.": "Raw capacity is the absolute total disk space available to the array subsystem.",
"Cluster ready for Regional-DR setup.": "Cluster ready for Regional-DR setup.",
"Setting up disaster recovery": "Setting up disaster recovery",
"Migrating cluster OSDs": "Migrating cluster OSDs",
"{{ migratedDevices }}/{{ totalOSD }} OSDs remaining": "{{ migratedDevices }}/{{ totalOSD }} OSDs remaining",
"Could not migrate cluster OSDs. Check logs": "Could not migrate cluster OSDs. Check logs",
"{{ migratedDevices }}/{{ totalOSD }} remaining": "{{ migratedDevices }}/{{ totalOSD }} remaining",
"Active health checks": "Active health checks",
"Progressing": "Progressing",
"The Compression Ratio represents the compressible data effectiveness metric inclusive of all compression-enabled pools.": "The Compression Ratio represents the compressible data effectiveness metric inclusive of all compression-enabled pools.",
Expand All @@ -585,10 +578,6 @@
"Performance metrics over time showing IOPS, Latency and more. Each metric is a link to a detailed view of this metric.": "Performance metrics over time showing IOPS, Latency and more. Each metric is a link to a detailed view of this metric.",
"Block and File service is unhealthy": "Block and File service is unhealthy",
"Object service is unhealthy": "Object service is unhealthy",
"(Prepare cluster for DR setup)": "(Prepare cluster for DR setup)",
"Prepare the cluster for Regional DR setup": "Prepare the cluster for Regional DR setup",
"To prepare the cluster for Regional DR setup, you must migrate the OSDs. Migrating OSDs may take some time to complete based on your cluster.": "To prepare the cluster for Regional DR setup, you must migrate the OSDs. Migrating OSDs may take some time to complete based on your cluster.",
"Yes, migrate OSDs": "Yes, migrate OSDs",
"Create Storage Pool": "Create Storage Pool",
"Storage pool delete modal": "Storage pool delete modal",
"Delete Storage Pool": "Delete Storage Pool",
Expand Down Expand Up @@ -889,8 +878,6 @@
"Selected versus Available Capacity": "Selected versus Available Capacity",
"Out of {{capacity}}": "Out of {{capacity}}",
"{{displayName}} connection details": "{{displayName}} connection details",
"Prepare cluster for disaster recovery (Regional-DR only)": "Prepare cluster for disaster recovery (Regional-DR only)",
"Set up the storage system for disaster recovery service with the essential configurations in place. This will subsequently allows seamless implementation of the disaster recovery strategies for your workloads.": "Set up the storage system for disaster recovery service with the essential configurations in place. This will subsequently allows seamless implementation of the disaster recovery strategies for your workloads.",
"Not connected": "Not connected",
"Backing storage": "Backing storage",
"Deployment type: {{deployment}}": "Deployment type: {{deployment}}",
Expand All @@ -915,8 +902,6 @@
"Encryption: {{encryptionStatus}}": "Encryption: {{encryptionStatus}}",
"In-transit encryption: {{hasInTransitEncryption}}": "In-transit encryption: {{hasInTransitEncryption}}",
"Network: {{networkType}}": "Network: {{networkType}}",
"Data protection": "Data protection",
"Regional-DR preparation: {{isRDRPreparationEnabled}}": "Regional-DR preparation: {{isRDRPreparationEnabled}}",
"Public Network Interface": "Public Network Interface",
"Select NetworkAttachmentDefinition": "Select NetworkAttachmentDefinition",
"Cluster Network Interface": "Cluster Network Interface",
Expand Down
47 changes: 0 additions & 47 deletions packages/mco/components/create-dr-policy/create-dr-policy.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,6 @@ const managedClusters: ACMManagedClusterKind[] = [
name: 'count.storagecluster.odf.openshift.io',
value: '1',
},
{
name: 'droptimized.odf.openshift.io',
value: 'true',
},
],
conditions: [
{
Expand Down Expand Up @@ -99,10 +95,6 @@ const managedClusters: ACMManagedClusterKind[] = [
name: 'count.storagecluster.odf.openshift.io',
value: '1',
},
{
name: 'droptimized.odf.openshift.io',
value: 'true',
},
],
conditions: [
{
Expand Down Expand Up @@ -209,10 +201,6 @@ const managedClusters: ACMManagedClusterKind[] = [
name: 'count.storagecluster.odf.openshift.io',
value: '2',
},
{
name: 'droptimized.odf.openshift.io',
value: 'true',
},
],
conditions: [
{
Expand Down Expand Up @@ -295,10 +283,6 @@ const managedClusters: ACMManagedClusterKind[] = [
name: 'count.storagecluster.odf.openshift.io',
value: '1',
},
{
name: 'droptimized.odf.openshift.io',
value: 'true',
},
],
conditions: [
{
Expand Down Expand Up @@ -350,10 +334,6 @@ const managedClusters: ACMManagedClusterKind[] = [
name: 'count.storagecluster.odf.openshift.io',
value: '1',
},
{
name: 'droptimized.odf.openshift.io',
value: 'true',
},
],
conditions: [
{
Expand Down Expand Up @@ -405,10 +385,6 @@ const managedClusters: ACMManagedClusterKind[] = [
name: 'count.storagecluster.odf.openshift.io',
value: '1',
},
{
name: 'droptimized.odf.openshift.io',
value: 'false',
},
],
conditions: [
{
Expand Down Expand Up @@ -661,27 +637,4 @@ xdescribe('Test drpolicy list page', () => {
// Create button should be disabled
expect(screen.getByTestId('create-button')).toBeDisabled();
});

test('Select non-DR optimized cluster test', async () => {
// Enter policy name
expect(screen.getByText('Policy name')).toBeInTheDocument();
fireEvent.change(screen.getByTestId('policy-name'), {
target: { value: 'policy-1' },
});
// Select east-1 DR optimized ODF
await waitFor(() => fireEvent.click(screen.getByTestId('east-1')));
// Select east-5 none DR optimized ODF
await waitFor(() => fireEvent.click(screen.getByTestId('east-5')));
// Error message for not DR optimized
expect(
screen.getByText('Cluster not pre-configured for Regional-DR')
).toBeInTheDocument();
expect(
screen.getByText(
'The selected cluster(s)[{{clusters}}] is not configured for Regional-DR setup. Migrate the OSDs to optimise the cluster for disaster recovery services.'
)
).toBeInTheDocument();
// Create button should be disabled
expect(screen.getByTestId('create-button')).toBeDisabled();
});
});
9 changes: 2 additions & 7 deletions packages/mco/components/create-dr-policy/create-dr-policy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ const CreateDRPolicy: React.FC<{}> = () => {
!!state.policyName &&
!!state.replicationType &&
state.selectedClusters.length === MAX_ALLOWED_CLUSTERS &&
!checkForErrors(state.selectedClusters, state.replicationType);
!checkForErrors(state.selectedClusters);

const loaded = mirrorPeerLoaded && policyLoaded;
const loadedError = mirrorPeerLoadError || policyLoadedError;
Expand Down Expand Up @@ -317,12 +317,7 @@ const CreateDRPolicy: React.FC<{}> = () => {
label={t('Selected clusters')}
>
{state.selectedClusters.map((c, i) => (
<SelectedCluster
key={c.name}
id={i + 1}
cluster={c}
replicationType={state.replicationType}
/>
<SelectedCluster key={c.name} id={i + 1} cluster={c} />
))}
</FormGroup>
)}
Expand Down
2 changes: 0 additions & 2 deletions packages/mco/components/create-dr-policy/reducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ export type StorageClusterInfoType = {
storageSystemNamespacedName: string;
// Ceph FSID to determine RDR/MDR.
cephFSID: string;
// OSDs are migrated for the RDR or not.
isDROptimized: boolean;
};

export type ODFConfigInfoType = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,6 @@ const getODFInfo = (
clusterClaims,
ClusterClaimTypes.STORAGE_CLUSTER_COUNT
);
const isDROptimized = getValueFromClusterClaim(
clusterClaims,
ClusterClaimTypes.DR_OPTIMIZED
);
return {
odfVersion: odfVersion,
isValidODFVersion: isMinimumSupportedODFVersion(
Expand All @@ -98,7 +94,6 @@ const getODFInfo = (
storageClusterNamespacedName: storageClusterNamespacedName,
storageSystemNamespacedName: storageSystemNamespacedName,
cephFSID: cephFsid,
isDROptimized: isDROptimized === 'true',
},
};
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,24 +62,19 @@ const getClusterErrorInfo = (
if (!storageClusterInfo?.cephFSID) {
acc.clustersWithUnsuccessfulODF.push(cluster.name);
}
if (!storageClusterInfo?.isDROptimized) {
acc.clustersWithoutDROptimizedODF.push(cluster.name);
}
return acc;
},
{
unavailableClusters: [],
clustersWithUnsupportedODF: [],
clustersWithoutODF: [],
clustersWithUnsuccessfulODF: [],
clustersWithoutDROptimizedODF: [],
}
);

const getErrorMessage = (
selectedClusters: ManagedClusterInfoType[],
requiredODFVersion: string,
replicationType: REPLICATION_TYPE,
isSyncPolicyFound: boolean,
t: TFunction
): ErrorMessageType => {
Expand Down Expand Up @@ -122,15 +117,6 @@ const getErrorMessage = (
names: clusterErrorInfo.clustersWithUnsuccessfulODF.join(' & '),
}),
};
} else if (!!clusterErrorInfo.clustersWithoutDROptimizedODF.length) {
return {
message: t('Cluster not pre-configured for Regional-DR'),
description: t(
'The selected cluster(s)[{{clusters}}] is not configured for Regional-DR setup. Migrate the OSDs to optimise the cluster for disaster recovery services.',
{ clusters: clusterErrorInfo.clustersWithoutDROptimizedODF.join(', ') }
),
isHidden: replicationType !== REPLICATION_TYPE.ASYNC,
};
}
return null;
};
Expand Down Expand Up @@ -184,7 +170,6 @@ export const DRReplicationType: React.FC<DRReplicationTypeProps> = ({
const errorMessage = getErrorMessage(
selectedClusters,
requiredODFVersion,
replicationType,
isSyncPolicyFound,
t
);
Expand Down Expand Up @@ -231,7 +216,7 @@ export const DRReplicationType: React.FC<DRReplicationTypeProps> = ({

return (
<>
{!!errorMessage && !errorMessage.isHidden ? (
{!!errorMessage ? (
<Alert
data-test="odf-not-found-alert"
className="odf-alert mco-create-data-policy__alert"
Expand Down Expand Up @@ -291,11 +276,9 @@ type ClusterErrorType = {
clustersWithUnsupportedODF: string[];
clustersWithoutODF: string[];
clustersWithUnsuccessfulODF: string[];
clustersWithoutDROptimizedODF: string[];
};

type ErrorMessageType = {
message?: string;
description?: string;
isHidden?: boolean;
};
15 changes: 4 additions & 11 deletions packages/mco/components/create-dr-policy/selected-cluster-view.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import * as React from 'react';
import { REPLICATION_TYPE } from '@odf/mco/constants';
import { parseNamespaceName } from '@odf/mco/utils';
import { RedExclamationCircleIcon } from '@odf/shared/status/icons';
import { useCustomTranslation } from '@odf/shared/useCustomTranslationHook';
Expand All @@ -17,38 +16,32 @@ import './create-dr-policy.scss';
type SelectedClusterProps = {
id: number;
cluster: ManagedClusterInfoType;
replicationType: REPLICATION_TYPE;
};

export const checkForErrors = (
clusters: ManagedClusterInfoType[],
replicationType: REPLICATION_TYPE
) =>
export const checkForErrors = (clusters: ManagedClusterInfoType[]) =>
clusters.some((cluster) => {
const { isManagedClusterAvailable, odfInfo } = cluster;
const { cephFSID, isDROptimized, storageSystemNamespacedName } =
const { cephFSID, storageSystemNamespacedName } =
odfInfo.storageClusterInfo;
const [storageSystemName] = parseNamespaceName(storageSystemNamespacedName);
return (
!isManagedClusterAvailable ||
!odfInfo?.isValidODFVersion ||
!storageSystemName ||
!cephFSID ||
(replicationType === REPLICATION_TYPE.ASYNC && !isDROptimized)
!cephFSID
);
});

export const SelectedCluster: React.FC<SelectedClusterProps> = ({
id,
cluster,
replicationType,
}) => {
const { t } = useCustomTranslation();
const { name, region, odfInfo } = cluster;
const [storageSystemName] = parseNamespaceName(
odfInfo.storageClusterInfo.storageSystemNamespacedName
);
const anyError = checkForErrors([cluster], replicationType);
const anyError = checkForErrors([cluster]);
return (
<Flex
display={{ default: 'inlineFlex' }}
Expand Down
1 change: 0 additions & 1 deletion packages/mco/constants/acm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ export enum ClusterClaimTypes {
STORAGE_SYSTEM_NAME = 'storagesystemname.odf.openshift.io',
CEPH_FSID = 'cephfsid.odf.openshift.io',
STORAGE_CLUSTER_COUNT = 'count.storagecluster.odf.openshift.io',
DR_OPTIMIZED = 'droptimized.odf.openshift.io',
}

// Managed cluster status conditions
Expand Down
Loading

0 comments on commit 8870314

Please sign in to comment.