Learn how to use the iLO Remote OS Installation to install a new operating system remotely using. To remotely install an operating system using the remote virtual media feature on an HP iLO interface. Hp virtual drives boot. ESX will not see these virtual CD rom drives, they are actually attached via ILO, not the hardware of the machine. So there is no way to get ESX to make them visible. If you want ISO access, you need to create an NFS share, and mount it to each ESX host as a datastore.
Add ability to provision proliant baremetal nodes (having iLO4 and beyond)by booting the baremetal node with virtual media and using iscsi from conductornode to deploy the image (reusing existing deploy mechanism).
Problem description¶
- Today Ironic’s PXE reference driver uses pxe protocol to boot the machine.Some customer’s don’t prefer PXE protocol in their environment because ofit unreliability and security issues.
- Today Ironic’s PXE reference driver passes the keystone authentication tokenin clear text over tftp on the data network to the baremetal node.
Proposed change¶
The proposed change for Ironic deploy will happen in two stages:
- Refactor the iSCSI deploy code in current pxe deploy driver into a new moduleironic/drivers/modules/iscsi_deploy.py so that it can be reused in a newdeploy driver.
- Add two new methods create_vfat_image and create_iso_image inironic/common/images.py for creating vfat images and iso images respectively.The vfat images will be used for passing the token and parameters to theramdisk when it is booted over virtual media. The ISO image will be used forbooting up the kernel/ramdisk on the baremetal machine.
- Add a new module ironic/common/swift.py to manage objects in swift.
- Add two generic methods setup_virtual_media_boot andcleanup_virtual_media__boot which helps in setting up and cleanup upvirtual media for booting respectively.
- Create a new deploy module named IloVirtualMediaIscsiDeploy inironic/drivers/modules/ilo/deploy.py which adheres tobase.DeployInterface.
- Create a new class VendorPassthru which adheres tobase.VendorInterface in ironic/drivers/modules/ilo/deploy.py.Implement a vendor passthru method pass_deploy_info in it.
- The reboot() method in IloPower module will be changed.
Virtual media for booting¶
This class exposes the following methods:
setup_virtual_media_boot()¶
- Validate that the node’s iLO has virtual media feature enabled usingproliantutils module. If the node doesn’t have virtual media feature, itcomes out with error.
- If boot_parameters is not empty:
- Create a virtual floppy image containing the user token and a configfile, which contains boot_parameters.
- Upload the virtual floppy image to swift. Set X-Delete-After for swiftto delete the image after deploy_helper_images_ttl minutes. The defaultvalue will be 10 minutes. Upload to container swift_ilo_container whosedefault value will be “ironic_ilo_container”.
- Generate the swift temp url for virtual floppy image. Let it be named asfloppy_image_temp_url. The timeout of tmpurl will bedeploy_helper_images_ttl minutes.
- Attach floppy_image_temp_url as virtual media floppy in the iLO. Set thetimeout to deploy_helper_images_ttl
- Generate tmpurl for boot_iso and attach it as virtual media cdrom. Thetimeout of tmpurl will be deploy_helper_images_ttl minutes.
- Set the baremetal node to boot from virtual media cdrom for the next bootusing proliantutils module with BOOT_ONCE option.
cleanup_virtual_media_boot()¶
- Remove the virtual media floppy image uploaded to swift for the node. Theobject name in swift will be “image-<node uuid>”
ironic/common/swift.py¶
This module will provide a class SwiftAPI which will handle the creationand managing swift objects. This SwiftAPI module by default will use admincredentials for talking to swift. The user of this module may also choose topass user, tenant_name, key, authurl to create the swiftAPIobject.
- upload_object - Creates the container if required and requested, andthen creates the new object in swift using swiftclient. Returns the swiftobject id.
- delete_object - Deletes the object from the mentioned swift container.
- get_tmp_url - This will call the swift_utils.generate_temp_url() whichis available in python-swiftclient.
ironic/common/images.py¶
Add a new method create_vfat_image which helps in creatingvirtual floppy images. This method takes the files and parameters to beincluded in the floppy image as input, and then creates a vfat floppy image.
Add a new method create_iso_image which helpsin creating ISO images.This method takes the files and parameters to be included in the ISO as input,and then creates the ISO image.
The common components between the two methods above will be reused.
ironic/drivers/modules/iscsi_deploy.py¶
This module will refactor every method belonging to the iscsi deploy mechanismfrom the pxe driver. The following methods will be moved to the new module:
- parse_instance_info()
- _cache_instance_image
- InstanceImageCache
- _check_image_size
- _destroy_images()
- _get_deploy_info
- _continue_deploy()
Minor changes will be required in the refactoring to remove the “pxe” portionsout of the above methods.
IloVirtualMediaIscsiDeploy¶
This class will implement the following:
- validate() - Validates that node has ports added, parses deploy_info(),checks that conductor api url is available, and validates that deploy_isoproperty exists in driver_info of node. Most of the functions fromrefactored iscsi_deploy is used.
- deploy() - Caches instance image, uses virtual media boot helper methodsetup_virtual_media_boot to setup the machine for booting withdriver_info[‘deploy_iso’].
- tear_down() - Powers down the node.
- clean_up() - Destroys the images, calls cleanup_virtual_media_bootmethod to clean the temporary floppy images. Decrements the usage_countfor boot_iso in swift and destroys the boot ISO image if theusage_count meta-property becomes 0 (if boot_iso was created byironic).
prepare() and take_over() will be empty.
VendorPassthru¶
Implement a new vendor passthru method ‘pass_deploy_info’. This vendor passthrumethod will call continue_deploy() from iscsi_deploy.py.
After deploying over iSCSI, it checks the following in that order to pick upa boot ISO:
- If user has specified a boot ISO in glance image, then it picks up this.
- Checks if a boot_iso is already available for the mentioned (image, kernel,ramdisk) for the image in swift on swift_ilo_container (by hashing theUUIDs of the image, kernel, ramdisk to get a unique name). If the bootiso exists, then the usage_count swift meta-property for the swiftobject is incremented by 1.
- If we still can’t find boot ISO, it creates a bootable ISO image, uploadsit to swift on swift_ilo_container with the generated name andsets usage_count to 1.
It then records the information about boot_iso in node’sinstance_info[boot_iso]
IloPower reboot()¶
If node has boot_iso in its instance_info, use setup_virtual_media_bootto set the machine to boot from boot_iso.
Alternatives¶
The proliant baremetal machines could be booted with proposed iPXE, but eventhat will involve booting the machine with PXE to load the iPXE software. Alsoit would not solve the security issues in token handoff to baremetal node.
Data model impact¶
The new deploy driver will use two new parameters:
- driver_info[‘deploy_iso’] - This will be used to boot up the node before thedeploy.
- instance_info[‘boot_iso’] - This is set by the deploy driver once thebaremetal node deploy completes.
REST API impact¶
One vendor_passthru method will be added:
pass_deploy_info:
- Description: The deploy ramdisk built using deploy-ironic element ofdiskimage-builder will call this method on the node. It will also passthe required information for completing the deploy after connecting to thebaremetal node’s local disk using iSCSI.
- Method type: POST
- Normal response code: 200
- Expected errors: 400: Insufficient/Invalid data sent or some data fordeployment missing.
- URL: /{api_version}/nodes/<node-uuid>/vendor_passthru/pass_deploy_info
- Parameters:
- address - Address of the baremetal node.
- key - The deployment key generated by ironic.
- iqn - The iqn of the target disk on baremetal node where the image hasto be deployed.
- error - The error message if some error was encountered.
- Body JSON schema:
- Response JSON: None
Driver API impact¶
None.
Nova driver impact¶
No changes are required on the nova ironic virt driver. The new iLO driverwill continue to use the below 5 parameters set by nova ironic virt driver inthe node’s instance_info:
- image_source
- root_gb
- swap_mb
- ephemeral_gb
- ephemeral_format
![Iso Iso](/uploads/1/2/6/2/126265351/526069204.png)
Security impact¶
- The PXE driver requires the admin token to be available on tftpwhich can be accessed by anyone in the deploy network (since the filename ofthe token is predicatable, which is token-<node uuid>). In virtual mediaboot, the user token is sent to the conductor node securely over httpsthrough OOB channel. Hence, this deploy method can be used for more securedeployments.
- The virtual floppy image is uploaded to a swift container with user tokenand is destroyed automatically by swift after the timeout. It is recommendedto use a separate container to secure the floppy images.
- Glance backed by swift can be configured to store the images such that theowner of the image and a defined list of admin accounts will be able toaccess the image. For more information refer usingswift_store_multi_tenant in [1].
Scalability impact¶
None.
![Ilo Virtual Media Iso Boot Ilo Virtual Media Iso Boot](https://community.hpe.com/hpeb/attachments/hpeb/itrc-264/123277/1/scr1.png)
Other deployer impact¶
The cloud operator is supposed to do the following as part of configuring theiLO driver:
- Upload the deploy_iso to glance and mention its UUID indriver_info[‘deploy_iso’].
Also, the user/operator may also optionally specify a boot_iso from whichthe kernel/ramdisk can be booted off for a deploy image. This may bespecified as a glance meta-property boot_iso for the image to be deployed.
Utilities will be provided in diskimage-builder for creating the deploy ISO.
This method of deploy doesn’t require an extra service (like tftp serviceincase of pxe driver) to be running on the conductor node.
Known Limitation¶
- If the user needs to reboot the baremetal node, then the reboot needs to betriggered from Ironic (or from Nova).
- If the user needs to issue an inband reboot of the baremetal node (rebootfrom within the baremetal node), then the baremetal node will fail to boot.In such a case, the user may just issue a reboot from ironic again to get thenode booted up.
Implementation¶
Work Items¶
The work will be split up into following separate items (or patches):
- Refactor the iSCSI deploy code in current pxe deploy driver.
- Implement the changes to ironic/common/images.py module.
- Implement the ironic/common/swift.py module.
- Implement the virtual media boot helper methods, add the new deploy driverand new vendor passthru module.
- Implement the changes to reboot() method in IloPower.
Dependencies¶
Depends on hpproliant module:
Testing¶
Unit tests will be added for all the code.
Tempest tests for the deploy will be considered later.
Documentation Impact¶
The procedure for configuring the proliant baremetal node will need to bedocumented. This will be documented in rst format in doc/ directory in ironicsource tree. The contents of this file can be put in ironic wiki as well.