Closed dafoyiming closed 1 year ago
@meshuga any idea? THX
@dafoyiming, thank you for submitting the question. You need to enable the encryption on the storage controller. See iDRAC 9 Encrypting virtual disks for details.
You can use the idrac_redfish_storage_controller
module to set the encryption key on the storage controller:
- name: Set controller encryption key
dellemc.openmanage.idrac_redfish_storage_controller:
baseuri: "192.168.0.1:443"
username: "{{ idrac_user }}"
password: "{{ idrac_password }}"
validate_certs: False
command: "SetControllerKey"
controller_id: "RAID.Slot.1-1"
key: "PassPhrase@123"
key_id: "mykeyid123"
@anupamaloke . thank you!
I had enabled the encryption key on its PERC. But, right now, I am trying to enable encryption on the virtual disk which I have created with this module "redfish_storage_volume". I can see the VD can be created without problem but the encryption is NOT even though I set the parameters as 'encrypted: true' BTW, I tested with 3 different choices with "encryption_types", but no luck
@dafoyiming , let me check it internally and come back to you.
@dafoyiming, In iDRAC firmware versions < 6.00.00.00, there is no one single action to do both create VD and secure it. So you'll have to execute to create VD, and then use iDRAC OEM extension to secure the VD.
iDRAC firmware version >=6.00.00.00, which just got released, supports virtual drive encryption. So Step 2 listed below is not needed. The redfish_storage_volume
module will create and encrypt the VD
redfish_storage_volume
module - this will create a VD and encrypt it in iDRAC >=v6.00.00.00- name: encrypt virtual disk
ansible.builtin.uri:
url: "https://{{ idrac_ip }}/redfish/v1/Systems/System.Embedded.1/Oem/Dell/DellRaidService/Actions/DellRaidService.LockVirtualDisk"
user: "{{ idrac_user }}"
password: "{{ idrac_password }}"
validate_certs: "{{ validate_certs }}"
force_basic_auth: True
method: POST
headers:
Content-Type: "application/json"
OData-Version: "4.0"
body:
- TargetFQDD: "{{ virtual_disk_fqdd }}"
body_format: json
status_code: [202]
register: lock_virtual_disk_response
delegate_to: localhost
- block:
when: lock_virtual_disk_response.status == 202
- name: extract the lock virtual disk command job id
ansible.builtin.set_fact:
lock_virtual_disk_job_id: "{{ lock_virtual_disk_response.location.split('/')[-1] }}"
- name: track the job till completion
dellemc.openmanage.idrac_lifecycle_controller_job_status_info:
idrac_ip: "{{ idrac_ip }}"
idrac_user: "{{ idrac_user }}"
idrac_password: "{{ idrac_password }}"
job_id: "{{ lock_virtual_disk_job_id }}"
register: lock_virtual_disk_job_status
until: lock_virtual_disk_job_status.job_info.Status == "Completed" or
lock_virtual_disk_job_status.job_info.Status == "Completed with Errors" or
lock_virtual_disk_job_status.job_info.Status == "Failed" or
lock_virtual_disk_job_status.job_info.Status == "Deleted"
failed_when: lock_virtual_disk_job_status.job_info.Status == "Failed"
changed_when: lock_virtual_disk_job_status.job_info.Status == "Completed" or
lock_virtual_disk_job_status.job_info.Status == "Completed with Errors"
retries: "{{ job_polling_retries }}"
delay: "{{ job_polling_interval }}"
delegate_to: localhost
Created #433 to add support for encyrpting VD for iDRAC FW versions < 6.00.00.00
@anupamaloke thank you for your support and I have encrypted the VD with your suggestion on step2. Looking forward to the module can be workable with no compatibility issue with iDrac<6.0 on #433 BTW, I think here is typo "//" in the URL you provided "https://{{ idrac_ip }}/redfish/v1/Systems/System.Embedded.1/Oem/Dell/DellRaidService/Actions/DellRaidService.LockVirtualDisk"
@dafoyiming, thanks for pointing out the typo 👍 I have corrected it now.
Closing this issue. The support for encrypting the virtual disk is going to be tracked with #433
How can the team help?
Details: ?
Team,
I am using the module redfish_storage_volume to create volume and I suppose the encrypted shall be enabled too while my playbook ran, but it doesn't work.
VD can be created successfully, but not any encryption job be scheduled. Please advise if this is a bug and what next step if I want to achieve this within one task.