cisco.ucs.ucs_service_profile_association module – Configures Service Profile Association on Cisco UCS Manager
Note
This module is part of the cisco.ucs collection (version 1.10.0).
You might already have this collection installed if you are using the ansible
package.
It is not included in ansible-core
.
To check whether it is installed, run ansible-galaxy collection list
.
To install it, use: ansible-galaxy collection install cisco.ucs
.
You need further requirements to be able to use this module,
see Requirements for details.
To use it in a playbook, specify: cisco.ucs.ucs_service_profile_association
.
New in cisco.ucs 2.1
Synopsis
Configures Service Profile Association (change association or disassociate) on Cisco UCS Manager.
Requirements
The below requirements are needed on the host that executes this module.
ucsmsdk
Parameters
Parameter |
Comments |
---|---|
IP address or hostname of Cisco UCS Manager. Modules can be used with the UCS Platform Emulator https://cs.co/ucspe |
|
The distinguished name (dn) of the organization where the resource is assigned. Default: |
|
Password for Cisco UCS Manager authentication. |
|
Port number to be used during connection (by default uses 443 for https and 80 for http connection). |
|
If use_proxy is no, specfies proxy to be used for connection. e.g. ‘http://proxy.xy.z:8080’ |
|
Restricts the migration of the service profile after it has been associated with a server. If set to no, Cisco UCS Manager does not perform any compatibility checks on the new server before migrating the existing service profile. If set to no and the hardware of both servers used in migration are not similar, the association might fail. Choices:
|
|
Specifies how to associate servers with this service profile using the following choices: server - Use to pre-provision a slot or select an existing server. Slot or server is specified by the server_dn option. pool - Use to select from a server pool. The server_pool option specifies the name of the server pool to use. Option is not valid if the service profile is bound to a template. Optional if the state is absent. Choices:
|
|
The Distinguished Name (dn) of the server object used for pre-provisioning or selecting an existing server. Required if the server_assignment option is server. Optional if the state is absent. |
|
Name of the server pool used for server pool based assignment. Required if the server_assignment option is pool. Optional if the state is absent. |
|
The name of the Service Profile being associated or disassociated. |
|
If If Choices:
|
|
If Choices:
|
|
If Choices:
|
|
Username for Cisco UCS Manager authentication. Default: |
Examples
- name: Change Service Profile Association to server pool Container-Pool and restrict migration
cisco.ucs.ucs_service_profile_association:
hostname: 172.16.143.150
username: admin
password: password
service_profile_name: test-sp
server_assignment: pool
server_pool_name: Container-Pool
restrict_migration: 'yes'
- name: Attempt to change association once a minute for up to 10 minutes
cisco.ucs.ucs_service_profile_association:
hostname: 172.16.143.150
username: admin
password: password
service_profile_name: test-sp
server_assignment: server
server_dn: sys/chassis-2/blade-1
register: result
until: result.assign_state == 'assigned' and result.assoc_state == 'associated'
retries: 10
delay: 60
- name: Disassociate Service Profile
cisco.ucs.ucs_service_profile_association:
hostname: 172.16.143.150
username: admin
password: password
service_profile_name: test-sp
state: absent
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
The logical server Assigned State (assigned, unassigned, or failed). Returned: success Sample: |
|
The logical server Association State (associated or unassociated). Returned: success Sample: |