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
- Install collection
ibm.power_hmc 1.16.0
- 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
- Run:
ansible-playbook playbook.yml -vvvv
- Observe the failure:
Expected behavior
The profile should be duplicated successfully.
Example:
becomes:
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:
in:
plugins/module_utils/hmc_rest_client.py
which currently sends a JSON JobRequest and consistently receives HTTP 415 from the HMC.
Describe the bug
The Ansible module
ibm.power_hmc.powervm_partition_profilefails when copying an existing PowerVM partition profile usingaction: copy.The module correctly:
The failure occurs during the REST API call used to perform the profile copy.
To Reproduce
ibm.power_hmc 1.16.0Expected behavior
The profile should be duplicated successfully.
Example:
becomes:
without modifying the original profile.
Screenshots
Error returned by the module:
Additional debug information:
HMC response:
I also modified the collection code for troubleshooting.
When forcing XML headers instead of JSON, the error changes to:
This suggests that the
CopyProfileREST endpoint exists and is reachable, but the request format used by the collection may not be accepted by the HMC.Environment
ibm.power_hmc 1.16.0powervm_partition_profilecopyVersion 10 Release 2 Service Pack 1041 (V10R2M1041)Additional context
The issue seems isolated to the
action: copyoperation.Other modules from the same collection work correctly using the same HMC and credentials, including:
powervm_lpar_instancehmc_commandThe problem appears to be within the implementation of:
copyPartitionProfile()in:
which currently sends a JSON JobRequest and consistently receives HTTP 415 from the HMC.