Hi Nicolas Vazquez

Forget to add
My global snapshot.backup.to.secondary = false

-Jerry

发件人: Nicolas Vazquez<mailto:nicolas.vazq...@shapeblue.com>
发送时间: 2020年10月27日 23:37
收件人: dev@cloudstack.apache.org<mailto:dev@cloudstack.apache.org>
主题: Re: Failed to create VOLUME from snapshot

Hi Jerry,

I currently don't have a Ceph setup to reproduce the issue, but I guess the 
issue was caused by some NullPointerException around the code you have 
commented out? Can you open a new pull request with your changes along with the 
error stack trace from the management server log?


Regards,

Nicolas Vazquez

________________________________
From: li jerry <div...@hotmail.com>
Sent: Tuesday, October 27, 2020 10:58 AM
To: dev@cloudstack.apache.org <dev@cloudstack.apache.org>
Subject: Failed to create VOLUME from snapshot

Hello All Dev User
I use CLOUDSTACK 4.14.0.0, KVMCEPH RBD primary storage and NFS secondary 
storage;

When creating a new VOLUME through a VOLUME snapshot,
Only the first snapshot of each VOLUME is successful;
No other snapshots of the same VOLUME can create a new VOLUME


Steps to reproduce:
1. Create a VOLUME snapshot;
2. Create VOLUME from the volume snapshot (successful);
3. Create a VOLUME snapshot;
4. Create VOLUME from volume snapshot (failure);

I looked at the code and found that when I was looking for storage through 
snapshots,
The snapshot ID and the VOLUME ID corresponding to the snapshot are used for 
query.

So I adjusted the query in the code:
apache-cloudstack-4.14.0.0-src/engine/storage/snapshot/src/main/java/org/apache/cloudstack/storage/snapshot/SnapshotDataFactoryImpl.java
    @Override
    public SnapshotInfo getSnapshot(long snapshotId, DataStoreRole role) {
        SnapshotVO snapshot = snapshotDao.findById(snapshotId);
        SnapshotDataStoreVO snapshotStore = 
snapshotStoreDao.findBySnapshot(snapshotId, role);
        if (snapshotStore == null) {
            return null;
//            snapshotStore = 
snapshotStoreDao.findByVolume(snapshot.getVolumeId(), role);
//            if (snapshotStore == null) {
//                return null;
//            }
            //end
        }
        DataStore store = storeMgr.getDataStore(snapshotStore.getDataStoreId(), 
role);
        SnapshotObject so = SnapshotObject.getSnapshotObject(snapshot, store);
        return so;
    }

Does anyone have a better solution?

Thank you!


-Jerry


nicolas.vazq...@shapeblue.com
www.shapeblue.com<http://www.shapeblue.com>
3 London Bridge Street,  3rd floor, News Building, London  SE1 9SGUK
@shapeblue



Reply via email to