libopenstorage / cloudops

Apache License 2.0
7 stars 13 forks source link

[PWX-28720] Added support for creating oracle encrypted block volumes #130

Closed vinayakshnd closed 1 year ago

vinayakshnd commented 1 year ago

Added support for creating oracle encrypted block volumes using customer managed key

Signed-off-by: Vinayak Shinde vinayakshnd@gmail.com

What this PR does / why we need it:

Which issue(s) this PR fixes (optional) Closes #

Special notes for your reviewer:

When no ocid of KMS key is mentioned, oracle block volume gets created using Oracle managed key:

go test -v .
=== RUN   TestAll
2023/02/02 13:36:04 volume [ocid1.volume.oc1.iad.abuwcljtjppdnwhxrl4nl7p6tbzjvs7lzqpyp6qpiocgcwalcdcy77ixsyfq] is still in [PROVISIONING] state Next retry in: 3s
2023/02/02 13:36:07 volume [ocid1.volume.oc1.iad.abuwcljtjppdnwhxrl4nl7p6tbzjvs7lzqpyp6qpiocgcwalcdcy77ixsyfq] is still in [PROVISIONING] state Next retry in: 3s
2023/02/02 13:36:10 volume [ocid1.volume.oc1.iad.abuwcljtjppdnwhxrl4nl7p6tbzjvs7lzqpyp6qpiocgcwalcdcy77ixsyfq] is still in [PROVISIONING] state Next retry in: 3s
Created disk: { AvailabilityDomain=ieuf:US-ASHBURN-AD-1 CompartmentId=ocid1.compartment.oc1..aaaaaaaag3eala7pagjlewfkh5q4jctmqxge6czs2cjhnmlvc7gfzzeyz6sa DisplayName=openstorage-test-8f02846d-bb50-48fe-9e37-4639da4389fb Id=ocid1.volume.oc1.iad.abuwcljtjppdnwhxrl4nl7p6tbzjvs7lzqpyp6qpiocgcwalcdcy77ixsyfq LifecycleState=AVAILABLE SizeInMBs=51200 TimeCreated=2023-02-02 13:36:04.589 +0000 UTC DefinedTags=map[Oracle-Tags:map[CreatedBy:default/vshinde@purestorage.com CreatedOn:2023-02-02T13:36:04.554Z]] FreeformTags=map[] SystemTags=map[] IsHydrated=true KmsKeyId=<nil> VpusPerGB=10 SizeInGBs=50 SourceDetails=<nil> VolumeGroupId=<nil> IsAutoTuneEnabled=false AutoTunedVpusPerGB=<nil> BlockVolumeReplicas=[] }
--- PASS: TestAll (10.24s)
PASS
ok      github.com/libopenstorage/cloudops/oracle   10.246s

When ocid of KMS key is mentioned, oracle block volume gets created using customer managed key:

go test -v .
=== RUN   TestAll
2023/02/02 13:38:48 volume [ocid1.volume.oc1.iad.abuwcljtingpbri2zp3sn5mvbjwqhjvluljbqizsbvx27e2nehqqpuqeupna] is still in [PROVISIONING] state Next retry in: 3s
2023/02/02 13:38:51 volume [ocid1.volume.oc1.iad.abuwcljtingpbri2zp3sn5mvbjwqhjvluljbqizsbvx27e2nehqqpuqeupna] is still in [PROVISIONING] state Next retry in: 3s
2023/02/02 13:38:54 volume [ocid1.volume.oc1.iad.abuwcljtingpbri2zp3sn5mvbjwqhjvluljbqizsbvx27e2nehqqpuqeupna] is still in [PROVISIONING] state Next retry in: 3s
2023/02/02 13:38:57 volume [ocid1.volume.oc1.iad.abuwcljtingpbri2zp3sn5mvbjwqhjvluljbqizsbvx27e2nehqqpuqeupna] is still in [PROVISIONING] state Next retry in: 3s
Created disk: { AvailabilityDomain=ieuf:US-ASHBURN-AD-1 CompartmentId=ocid1.compartment.oc1..aaaaaaaag3eala7pagjlewfkh5q4jctmqxge6czs2cjhnmlvc7gfzzeyz6sa DisplayName=openstorage-test-cbbde93b-a9be-4be6-a923-436e39aa755d Id=ocid1.volume.oc1.iad.abuwcljtingpbri2zp3sn5mvbjwqhjvluljbqizsbvx27e2nehqqpuqeupna LifecycleState=AVAILABLE SizeInMBs=51200 TimeCreated=2023-02-02 13:38:48.434 +0000 UTC DefinedTags=map[Oracle-Tags:map[CreatedBy:default/vshinde@purestorage.com CreatedOn:2023-02-02T13:38:48.154Z]] FreeformTags=map[] SystemTags=map[] IsHydrated=true KmsKeyId=ocid1.key.oc1.iad.b5r5xcpzaaazi.abuwcljtdusjtinjk6a5z2dgo55khyvw5myqmmb3nb3nqs7p2s7nwpt2ziea VpusPerGB=10 SizeInGBs=50 SourceDetails=<nil> VolumeGroupId=<nil> IsAutoTuneEnabled=false AutoTunedVpusPerGB=<nil> BlockVolumeReplicas=[] }
--- PASS: TestAll (13.30s)
PASS
ok      github.com/libopenstorage/cloudops/oracle   13.313s
Screenshot 2023-02-02 at 7 09 23 PM