CiscoUcs / imcsdk

Python SDK for Cisco IMC

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

VMedia removal causing "The attribute 'adminAction' is required but missing." parse error.

dscoular opened this issue · comments

Hi Fellow Travellers,
I'm seeing the following issue when using a recent git clone of the imcsdk (post 0.9.3 to get the python 3 vmedia fixes circa 27th Feb 2018).

Whenever I try to delete vmedia I get:

"imcsdk.imcexception.ImcException: [ErrorCode]: ERR-xml-parse-error[ErrorDescription]: XML PARSING ERROR: Element 'commSavedVMediaMap': The attribute 'adminAction' is required but missing."

Obviously something has gone wrong in the mapping of Managed Objects to XML.

This is when I call vmedia.vmedia_mount_remove_all(handle) or vmedia.vmedia_mount_delete(handle, volume_name) any thoughts?

Here's a snippet of the code I'm using under python 3.6.2 MacOS High Sierra against a stand alone c240m5:

def vmedia_boot():
    volume_name="myVmedia"

    with ImcHandle(server, username, password) as handle:
        try:
            vmedia.vmedia_mount_remove_all(handle)
        except ImcException as error:
            print(f"Error: {error}") // This is where we get the error.
        try:
            vmedia.vmedia_mount_create(
                handle,
                volume_name,
                map="www",
                mount_options="",
                remote_share='http://10.199.133.8:8888/images/CentOS-7-x86_64-LiveGNOME-1708/',
                remote_file='CentOS-7-x86_64-LiveGNOME-1708.iso',
            )
        except ImcException as error:
            print(f"Error: {error}")
        comm_vmedia = vmedia.vmedia_enable(handle)
        result = boot.boot_order_precision_set(
            handle,
            reboot_on_update="yes",
            reapply="no",
            #configured_boot_mode="Uefi",
            boot_devices = [
                {
                    "order":'1', "device-type":"vmedia",
                    "name": "vmedia"
                }
            ]
        )

        return result

Any help hugely appreciated.

Cheers,

Dug

@dscoular this happens when you've got a saved but not active vmedia mapping, which is somehow treated differently than an active mapping. I haven't figured out a way around this yet, other than manually deleting the saved mapping (but I haven't looked too hard at it either...).

This issue is stale because it has been open for 60 days with no activity.

This issue was closed because it has been inactive for 14 days since being marked as stale.