Boot nodes from virtual, rather than local, CD
[ta/ironic-virtmedia-driver.git] / src / ironic_virtmedia_driver / vendors / dell / dell.py
index e4fb255..5c188fa 100644 (file)
@@ -122,7 +122,7 @@ class DELL(IronicVirtMediaHW):
             self.log.debug("attach_virtual_cd")
             connection = self._init_connection(driver_info)
             self._check_supported_idrac_version(connection)
-            image_location = 'http://' + driver_info['provisioning_server'] + ':' + driver_info['provisioning_server_http_port'] + self.remote_share + image_filename
+            image_location = 'http://' + str(driver_info['provisioning_server']) + ':' + str(driver_info['provisioning_server_http_port']) + self.remote_share + image_filename
             self._mount_virtual_cd(connection, image_location)
 
             connection.logout()
@@ -158,4 +158,20 @@ class DELL(IronicVirtMediaHW):
             self.log.warning('Failed to disable booting options: %s', str(err))
         #For time being lets do the boot order with ipmitool since, well dell doesn't provide open support
         #for this.
-        manager_utils.node_set_boot_device(task, boot_devices.CDROM, persistent=False)
+        try:
+          # 0x00 0x08 0x05 0x80 0x20: chassis|set|bootdev|for next boot only|remote CD
+          # other options for device (per ipmitool's "ipmi_chassis.c"):
+          # 04: PXE
+          # 08: HDD
+          # 0c: Safe
+          # 10: Diag
+          # 14: CDROM
+          # 18: Setup
+          # 1c: Remote FDD
+          # 24: Remote primary media
+          # 2c: Remote HDD
+          # 3c: FDD
+          ipmitool.send_raw(task, '0x00 0x08 0x05 0x80 0x20 0x00 0x00 0x00')
+          self.log.info('Set next boot to remote media')
+        except Exception as err:
+            self.log.warning('Failed to set next boot to remote media: %s', str(err))