Open tonyadolph opened 6 years ago
Hi Tonny
I think I will create a resourceOvmSeM (storageElement resource) that have attributes like
My OVM at home have died so will try to do some coding in the black that you can test and my HW setup only support virtdualDisk...
I started but stalled due to lack of golang experience. But I planned the same, but would have a storageElementId too. The object that gets passed to VmDiskMapping in my python version looks like this:
obj = {
"userData": [],
"locked": False,
"description": "mapping for {racNode}".format(racNode=racNodeName),
"generation": 1,
"storageElementId": storageElementId,
"vmId": racNodeObj['id'],
"diskWriteMode": "READ_WRITE",
"readOnly": False,
"emulatedBlockDevice": False,
"virtualDiskId": virtualDiskId,
"resourceGroupIds": [],
"diskTarget": diskTarget,
"id": None,
"name": "Mapping for disk Id ({diskId})".format(diskId=diskId)
}
where storageElementId
and virtualDiskId
are mutually exclusive.
I look forward to seeing your implementation. And I'll be happy to test it.
Hi Björn
As discussed, I have attached a python script that mimics most of the apply and destroy functionality of terraform providers. I created it in python as my golang skills at the moment are limited.
I hope that this will help in creating StorageElementMapping functionality.
If you take a look at the function
createVmDiskMapping(s,baseUri,racNodeObj,asmDisks):
You'll see the difference between the vmd mapping and storageElement mapping is only in the dataobject, either"storageElementId": storageElementId,
or"virtualDiskId": virtualDiskId,
is populated. The tricky bit is getting the the storageElementId.For that see getDiskObjByWwid(s,baseUri,diskWwid):
and
I hope that my python script clear. createRACnodes.zip
See the config file asmDisks section where the WWID of the external disk aka StorageElement
,"asmDisks":[ { "name": "ASM_DISK1" ,"diskType": "PHYSICAL_DISK" ,"size": 5 ,"shareable": true ,"sparse": "No" ,"description": "ASM RAC Shared Disk TonyA testing" ,"obj": null ,"wwid": "600601600ec03600cb545b949352e811" },
I've added two config files, one for Virtual Disks, one for Physical.createRAC.zip
Rgds Tony