IBM / ibmcloud-storage-volume-lib

A helper ibm cloud storage client library to assist in interacting with IBM Cloud storage. Provides access to key volume lifecycle operations
Apache License 2.0
6 stars 20 forks source link

SOFTLAYER-FILE VoluemGet doens't have all the important fields. #19

Open depohmel opened 5 years ago

depohmel commented 5 years ago

Here is the example of VoluemGet via Provider

&{VolumeID:62967589 Provider:SOFTLAYER-FILE VolumeType:file ProviderType:ENDURANCE_FILE_STORAGE Capacity:0xc0002c5590 SnapshotSpace:0xc000904210 Iops:0xc0006069f0 Tier:0xc0003ac1b0 Region:us-south Az:sjc03 BillingType: CreationTime:2019-01-29 14:52:23 -0600 -0600 ServiceOffering:<nil> VolumeNotes:map[plugin:ibm-file-plugin-77 region:us-south cluster:d843ddc67ffc4 type:Endurance] LunID: TargetIPAddresses:[]}

And here is an example for the same volume from SL backend

{"capacityGb":20,"createDate":"2019-01-29T14:52:23-06:00","id":62967589,"notes":"{\"plugin\":\"ibm-file-\"type\":\"Endurance\",}","parentVolume":{"accountId":1674595,"capacityGb":20,"createDate":"2019-01-29T18:05:57-06:00",","nasType":"SNAPSHOT","notes":"{some notes here}","serviceProviderId":1,"**serviceResourceBackendIpAddress":"HOSTNAME OF ASERVICE.service.softlayer.com"**,"serviceResourceName":"Storage Type 02 File Aggregate stff-sjc0301a","snapshotSizeBytes":"102400","storageTypeId":"16","upgradableFlag":true,**"username":"USSERNAME"**},"provisionedIops":"40","serviceResource":{"backendIpAddress":"HOSTNAME OF ASERVICE.service.softlayer.com","datacenter":{"name":"sjc03"},,"name":"Storage Type 02 File Aggregate stff-sjc0301a","type":{""}},"snapshotCapacityGb":"20","storageTierLevel":"READHEAVY_TIER","storageType":{"keyName":"ENDURANCE_FILE_STORAGE"},"username":"USSERNAME"}

Important and missing fields are:

serviceResourceBackendIpAddress or backendIpAddress username

These fields are required if you want ot recreate PVC for K8s snapshot.

Ideally it would be nice to see all the fields whicha re avalible on UI image

depohmel commented 5 years ago

I might be wrong, but looks like by uncommenting these lines https://github.com/IBM/ibmcloud-storage-volume-lib/blob/43bc976e693ddf3e64d6647ed09d8ccd429b8aa9/volume-providers/softlayer/utils/storage_utils.go#L486 https://github.com/IBM/ibmcloud-storage-volume-lib/blob/43bc976e693ddf3e64d6647ed09d8ccd429b8aa9/volume-providers/softlayer/utils/storage_utils.go#L467 some of info will appear in VolumeGet

pramodgavali commented 5 years ago

@depohmel you are correct .. I'll fix it in next change of iteration