glusterd2 icon indicating copy to clipboard operation
glusterd2 copied to clipboard

Wrong Volname is displayed in the output of curl command deactivate

Open Shrivaibavi opened this issue 6 years ago • 5 comments

Description: I tried to deactivate the snapshot by using REST API. It deactivated also. But when i checked the dictionary generated. I saw the "VolumeName: snap3" but snap3 is snapshot name. This either should be "SnapName:snap3" or "VolumeName:vol1"

[root@dhcp35-5 ~]# curl -X POST http://10.70.35.5:24007/v1/snapshot/snap3/deactivate

{"ID":"7f1c8d2a-4aba-4846-ac2d-f89d7c2b2b41","Name":"snap3","VolfileID":"snaps/snap3","Type":1,"Transport":"tcp","DistCount":1,"Options":{"bitrot-stub.bitrot":"off","feature.deem-statfs":"off","features.barrier":"disable","features.inode-quota":"off","features.quota":"off","features.quota-deem-statfs":"off","features.read-only":"on","features.uss":"off","replicate.self-heal-daemon":"off"},"State":1,"Checksum":0,"Version":0,"Subvols":[{"ID":"93b80862-c574-4401-8c53-98a7c1209c96","Name":"snap3-replicate-0","Type":1,"Bricks":[{"ID":"71f070ec-6eae-4757-86f6-e2941fc3163c","Hostname":"10.70.35.5","PeerID":"8fa3e7e6-a5ac-47b2-9ba3-ca29997dbeb0","Path":"/var/run/glusterd2/snaps/vol2/d8750991ab2749ca92910897a0c7a766/snap3/brick1/vol2",**"VolumeName":"snap3**","VolumeID":"7f1c8d2a-4aba-4846-ac2d-f89d7c2b2b41","Type":0,"Decommissioned":false,"Mountdir":"/vol2","DevicePath":"/dev/vg2/snap_snap3_1","FsType":"xfs","MntOpts":"rw,seclabel,noatime,nodiratime,attr2,inode64,logbsize=256k,sunit=512,swidth=512,noquota,nouuid"},{"ID":"c7ba9a6b-0cdf-4d6f-b391-26ca90aec3e5","Hostname":"10.70.35.47","PeerID":"d112190f-5213-417f-83c6-4ba045ead1c4","Path":"/var/run/glusterd2/snaps/vol2/24819888487f4d43b9b8f23362a3d4ee/snap3/brick1/vol2",**"VolumeName":"snap3"**,"VolumeID":"7f1c8d2a-4aba-4846-ac2d-f89d7c2b2b41","Type":0,"Decommissioned":false,"Mountdir":"/vol2","DevicePath":"/dev/vg2/snap_snap3_1","FsType":"xfs","MntOpts":"rw,seclabel,noatime,nodiratime,attr2,inode64,logbsize=256k,sunit=512,swidth=512,noquota,nouuid"},{"ID":"63d5c3ab-1ab0-483f-b0e4-b243d9345419","Hostname":"10.70.35.179","PeerID":"3c23daaf-f343-4ac8-bd3f-186a44101df2","Path":"/var/run/glusterd2/snaps/vol2/25cf9ac94757494dbbb8ee188bf7df87/snap3/brick1/vol2",**"VolumeName":"snap3"**,"VolumeID":"7f1c8d2a-4aba-4846-ac2d-f89d7c2b2b41","Type":0,"Decommissioned":false,"Mountdir":"/vol2","DevicePath":"/dev/vg2/snap_snap3_1","FsType":"xfs","MntOpts":"rw,seclabel,noatime,nodiratime,attr2,inode64,logbsize=256k,sunit=512,swidth=512,noquota,nouuid"}],"Subvols":null,"ReplicaCount":3,"ArbiterCount":0,"DisperseCount":0,"RedundancyCount":0}],"Auth":{"Username":"99308a84-4c27-427f-8f1d-3e6284b9d09e","Password":"05894f20-f58c-4bea-8c44-0549d1196239"},"GraphMap":null,"Metadata":null,"SnapList":null}

Shrivaibavi avatar Aug 14 '18 10:08 Shrivaibavi

we are displaying "GraphMap":null,"Metadata":null,"SnapList":null} null as value need to fix this also

Madhu-1 avatar Aug 14 '18 12:08 Madhu-1

@aravindavk

"VolumeName": "snap3" ,

"VolumeID": "7f1c8d2a-4aba-4846-ac2d-f89d7c2b2b41"

the volume ID and the name is taken as the snapshot name and snapshot ID, do we need to use volume ID and volume name as the old volume from which snapshot is created?

Madhu-1 avatar Aug 17 '18 06:08 Madhu-1

Snapshots are also Gluster Volumes, Both original Volume and Snapshot Volume can't run together if they have same volume name and ID. On Snapshot create snapshot name will be used as Volume name(Same for ID). Original volume info will be available with Glusterd2, which will be used while restore.

@rafikc30 as @Madhu-1 suggested, we can add OriginVolumeName and OriginVolumeID in response. or change VolumeName to SnapshotName and keep VolumeName as OriginVolumeName in the response.

aravindavk avatar Aug 17 '18 06:08 aravindavk

@aravindavk Do we need to provide all this information after snapshot deactivate?, IMO just a message confirming the deactivation or a http.OK response should be enough.

Also when we create snapshot, the volume-name in each bricks changes to the snap-name, and the output displays the parentname as the original volume name. I think we need to change the parent name to OriginalVolumeName.

rishubhjain avatar Aug 27 '18 14:08 rishubhjain

@aravindavk Any updates on this ? Do we need to change the snapname or the current behaviour is fine ?

vpandey-RH avatar Oct 23 '18 07:10 vpandey-RH