Scenario
- Product: ZCF
- Component: ZStack Cloud
- Version: 4.8.x
- Deployment: Dual management nodes
- Trigger: A sharedblock volume installation path differs from its snapshot path and requires database-metadata correction.
Symptoms
- A volume installation path is inconsistent.
- The current snapshot path and volume path point to different objects.
- Volume metadata and snapshot-tree metadata must both be checked.
Assessment
- Check the target volume installPath in VolumeVO.
- Check treeUuid, parentUuid, and latest for related snapshots.
- When a snapshot tree has multiple records, identify the snapshot chain to retain.
Cause
An inconsistent volume installation path requires direct correction of volume-path metadata and cleanup of abnormal snapshot-tree references so that the volume and snapshot chain are consistent.
Resolution
- Preparation
- Risk level: High.
- Disable global ZStack Cloud high availability.
- Back up databases on both management nodes.
- This procedure changes database entries; strictly verify UUIDs and paths.
- Disable high availability and back up the database:
~~~bash zstack-ctl dump_mysql ~~~
- Expected result: A rollback baseline is available.
- Query the current volume path:
~~~sql select * from VolumeVO where uuid='8b389dfd74f84e0f9d5edc15e99b3cbc'\\G; ~~~
- Expected result: It is clear whether the current installPath differs from the expected path.
- Correct the volume path:
~~~sql update VolumeVO set installPath = 'sharedblock://f9c3c78f7674441ba97003c0b21265c8/97793a14251b4c9684d03b9ec87f406f' where uuid = '8b389dfd74f84e0f9d5edc15e99b3cbc'; ~~~
- Expected result: The volume metadata path is corrected.
- Query the treeUuid for the abnormal snapshot:
~~~sql select from VolumeSnapshotVO where uuid="ed4372d07adf41e8b6cc2afce65a18b1"\\G; select from VolumeSnapshotVO where treeUuid="ba19dff9e5d44c8d9594b1dd828e63d9"\\G; select from VolumeSnapshotTreeVO where uuid="ba19dff9e5d44c8d9594b1dd828e63d9"\\G; select from VolumeSnapshotReferenceVO where referenceUuid="ba19dff9e5d44c8d9594b1dd828e63d9"\\G; ~~~
- Expected result: The snapshot-tree structure and references are identified.
- If the current treeUuid contains multiple snapshots, delete the abnormal snapshot:
~~~sql delete from VolumeSnapshotVO where uuid="ed4372d07adf41e8b6cc2afce65a18b1"; ~~~
- Expected result: The abnormal snapshot record is removed.
- Query the remaining parentUuid and snapshot chain:
~~~sql select from VolumeSnapshotVO where treeUuid="ba19dff9e5d44c8d9594b1dd828e63d9"\\G; select from VolumeSnapshotVO where uuid="8eded03f3c394dfdbf68f1313a2bbe32"; ~~~
- Expected result: The snapshot record to retain is identified.
- Set the retained snapshot latest value to true:
~~~sql Update VolumeSnapshotVO set latest=true where uuid="8eded03f3c394dfdbf68f1313a2bbe32"; ~~~
- Expected result: Snapshot-tree state is consistent.
- Enable global high availability.
- Expected result: Normal platform operation is restored.
Verification
- Verify that VolumeVO installPath is the correct path.
- Verify that abnormal snapshots are removed from the snapshot tree.
- Verify that the retained snapshot has the correct latest flag.
- Verify normal platform and workload operation.
Risks and rollback
- Risk: Incorrect UUID validation before direct metadata update or deletion can damage a volume or snapshot chain.
- Risk level: High.
- Rollback: Restore the database backup directly.
