Skip to content

powervm_partition_profile "profile copy" #175

Description

@zayo46

Describe the bug

The Ansible module ibm.power_hmc.powervm_partition_profile fails when copying an existing PowerVM partition profile using action: copy.

The module correctly:

  • Authenticates to the HMC
  • Finds the managed system
  • Finds the LPAR
  • Finds the source profile
  • Verifies that the destination profile does not already exist

The failure occurs during the REST API call used to perform the profile copy.


To Reproduce

  1. Install collection ibm.power_hmc 1.16.0
  2. Execute:
- name: Backup LPAR profile
  ibm.power_hmc.powervm_partition_profile:
    hmc_host: "{{ hmc_host }}"
    hmc_auth:
      username: "{{ user_hmc }}"
      password: "{{ hmc_pass }}"
    system_name: "CHASSIS"
    vm_name: "LPAR"
    name: "default"
    duplicate_prof_name: "backup"
    action: copy
  1. Run:
ansible-playbook playbook.yml -vvvv
  1. Observe the failure:
HTTP Error 415

Expected behavior

The profile should be duplicated successfully.

Example:

default

becomes:

default
backup

without modifying the original profile.


Screenshots

Error returned by the module:

fatal: FAILED! => {
  "changed": false,
  "msg": "Error: HTTP Error 415:"
}

Additional debug information:

PUT /rest/api/uom/LogicalPartition/<UUID>/do/CopyProfile
Accept: application/json
Content-Type: application/vnd.ibm.powervm.web+json; type=JobRequest

HMC response:

HTTP 415 Unsupported Media Type

I also modified the collection code for troubleshooting.

When forcing XML headers instead of JSON, the error changes to:

HTTP 400
REST0001 Failed to unmarshal input payload.
The supplied XML request body did not pass XML validation.

This suggests that the CopyProfile REST endpoint exists and is reachable, but the request format used by the collection may not be accepted by the HMC.


Environment

  • Collection: ibm.power_hmc 1.16.0
  • Module: powervm_partition_profile
  • Action: copy
  • HMC: Version 10 Release 2 Service Pack 1041 (V10R2M1041)

Additional context

The issue seems isolated to the action: copy operation.

Other modules from the same collection work correctly using the same HMC and credentials, including:

  • powervm_lpar_instance
  • hmc_command
  • Profile and partition information retrieval

The problem appears to be within the implementation of:

copyPartitionProfile()

in:

plugins/module_utils/hmc_rest_client.py

which currently sends a JSON JobRequest and consistently receives HTTP 415 from the HMC.

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions