I am attempting to create a flexclone that resides in a different vserver from the parent volume. These attempts are using Python SDK with ONTAP 9.2. The CLI equivalant of the API commands works just fine.
The XML of my request is below [1] used by doing toEncodedString() on the API request. Message I get is "Extra input: junction-path". If I run the same command via CLI , I am successful:
netapp-home::> volume clone create -parent-vserver systems -parent-volume owens_root_rhel73_3 -parent-snapshot clone.owens_root_rhel73_test -vserver test -flexclone owens_root_rhel73_test -type rw -space-guarantee volume -junction-path /owens_root_rhel73_test
[Job 19548] Job is queued: Create owens_root_rhel73_test.
The code I'm using is below. My parameters are logged below too:
[2017-08-29 08:33:46,611] INFO: Creating flexclone parent-volume=owens_root_rhel73_3 parent-snapshot=clone.owens_root_rhel73_test2 volume=owens_root_rhel73_test2 junction-path=/owens_root_rhel73_test2
def create_flexclone(self, parent_volume, parent_snapshot, volume, parent_vserver=None, vserver=None, space_reserve='volume'):
flexclone_create = NaElement('volume-clone-create')
if parent_vserver != vserver:
flexclone_create.child_add_string('parent-vserver', parent_vserver)
flexclone_create.child_add_string('vserver', vserver)
# Force connection to be not to specific vserver
self.clear_vserver()
flexclone_create.child_add_string('parent-volume', parent_volume)
flexclone_create.child_add_string('parent-snapshot', parent_snapshot)
flexclone_create.child_add_string('volume', volume)
flexclone_create.child_add_string('volume-type', 'rw')
flexclone_create.child_add_string('junction-path', "/%s" % volume)
flexclone_create.child_add_string('space-reserve', space_reserve)
log.info("Creating flexclone parent-volume=%s parent-snapshot=%s volume=%s junction-path=/%s",
parent_volume, parent_snapshot, volume, volume)
print flexclone_create.toEncodedString()
out = self.s.invoke_elem(flexclone_create)
log.info("Create flexclone %s", out.results_status())
if out.results_errno() != 0:
log.error("Create flexclone %s reason=%s", out.results_status(), out.results_reason())
return out.results_errno()
The error:
[2017-08-29 08:33:46,744] ERROR: Create flexclone failed reason=Extra input: junction-path
[1]:
<volume-clone-create><parent-vserver>systems</parent-vserver><vserver>test</vserver><parent-volume>owens_root_rhel73_3</parent-volume><parent-snapshot>clone.owens_root_rhel73_test2</parent-snapshot><volume>owens_root_rhel73_test2</volume><volume-type>rw</volume-type><junction-path>/owens_root_rhel73_test2</junction-path><space-reserve>volume</space-reserve></volume-clone-create>