summaryrefslogtreecommitdiff
path: root/ironic_python_agent/shell
Commit message (Collapse)AuthorAgeFilesLines
* Fix for fatal error when GPT was used and only MBR was cleanedOlivier Bourdon2018-05-191-1/+1
| | | | | | | | | | | | | | | | | | You can generate this error if after having provisioned a node using GPT partitioning, you clean its MBR using say dd if=/dev/zero bs=1024 count=1 of=/dev/sda and then cleanup all Ironic/Bifrost informations to get it reprovisioned. In this case sgdisk -Z returns an error and last_error field in Ironic contains: Error writing image to device: Writing image to device /dev/sda failed with exit code 2 Caution: invalid main GPT header, but valid backup; regenerating main header\nfrom backup!\n \nInvalid partition data!\ Change-Id: Ib617737fff5e40cb376edda0232e0726d9c71231 (cherry picked from commit 5fcf3f066ccdbcc081ae35ab25f1c18737b94778)
* Limit memory usage when running qemu-img convertLucas Alvares Gomes2017-01-191-0/+3
| | | | | | | | | This patch is limiting the memory address space to 1 GiB when invoking qemu-img convert. The qemu-img command can be exploited so we better play on the safe side (See: bug #1449062). Change-Id: I2088f74b32d1392310c569cfaa7fd368cb737421 Closes-Bug: #1657808
* Moving Reboot bashscript to pythonBharath kumar2016-12-151-26/+0
| | | | | | | | | | | | Currently a reboot bash script file is used to call reboot and poweroff operation. Deleting this file and moving the code to python file using utils.execute() Partial-Bug: #1557542 Change-Id: Iad9cd9d15417e9a954d108d2759e6303452fca27 Author: Bharath kumar <shettybharath4@gmail.com> Co-Authored-By: Annie Lezil <annie.lezil@gmail.com>
* Add bash scripts style checking for IPAOpenStack Proposal Bot2016-11-091-5/+5
| | | | | | | | | Updated file tox.ini allows to check code style in all ".sh" files included in Ironic Python Agent. Checking can be invoked by calling either "tox" or "tox -e pep8". Change-Id: Ie76605737c7db10a064f2aebfda388372a4c0591 Closes-Bug: #1625215
* Use ironic-lib to create configdriveShivanand Tendulker2016-10-211-118/+0
| | | | | | | | | Shell script to create config drive being replaced with python code in ironic-lib. Closes-Bug: #1493328 Change-Id: I31108f1173db3fb585386b2949ec880a95305fb6
* Fix config drive writing scriptVladyslav Drok2016-10-181-6/+6
| | | | | | | | | | | | | | | When the deployment happens on a GPT disk with config drive, writing it to disk fails. Three reasons for that: * parted should be used instead of partprobe to determine the type of the disk; * gdisk -l sorts the partitions by their number, sort them by start sector instead; * after sgdisk completion, the configdrive device is not immediately visible in the /dev folder, udevadm settle needed here too. Closes-Bug: #1633063 Change-Id: Ifed89e343f9db4cf303baf7f8823342f6041f202
* Prevent failure on 'copy_configdrive_to_disk.sh'Ricardo Araújo Santos2016-05-171-1/+1
| | | | | | | | | | | | The script splits 'sfdisk' output wrongly in blank spaces leading to failures when partition id is greater than 10, e.g.: "/dev/sda10: start= ...". This fix splits the output on ":" and trims trailing space when partition id is less than 10, e.g.: "/dev/sda1 : start= ...". Change-Id: I23f4b747fc0a86713cb912afc5d193398e6a597b Closes-Bug: 1581699
* Replace SYSRQ commandsLucas Alvares Gomes2016-03-211-7/+4
| | | | | | | | | | | | | | | | | | | | This patch is modifying the shutdown.sh script to not use SYSRQ when performing power actions. SYSRQ has a similar effect to a hardware reset button/power switch, which can be problematic after copying an image to the disk (data loss) therefore, this patch is changing the script to use soft power action via the poweroff and reboot commands. SYSRQ was required before because the ironic-python-agent service was running inside a docker container, but since we've moved it to run into a chroot (when built with coreos) or on the ramdisk's OS (when built with DIB) the SYSRQ actions are not needed anymore. In many parts of Ironic we were considering the standby.{power_off, reboot} methods of IPA to be soft actions, which they are not at present. This patch is also fixing that assumption. Change-Id: Ibe3a3f61a4a0e98b2c2501ad95154839933b4d7a Closes-Bug: #1557450
* Clear GPT and MBR data structures on disk before imagingShivanand Tendulker2016-02-091-2/+2
| | | | | | | | | This patch clears all GPT and MBR data structures on the disk. GPT maintains its data structures at start and at end of the disk. Change-Id: I8d0b367755b568cb44f02f62b873659b4bea0f14 Closes-Bug: #1543339
* Add tinyipa to IPA imagebuild directorySam Betts2016-01-291-0/+3
| | | | | | | | | TinyCoreLinux is a small 10mb base linux distribution which can easily be built into a ramdisk for PXE and ISO booting. This patch adds scripts and other required files to build a TinyCore based ramdisk which runs the Ironic Python Agent. Change-Id: I79fbec75de19b3d6feb19f87a3a0f662eae42bf3
* Create partition at max msdos limit for disks > 2TBYolanda Robla2015-11-181-2/+14
| | | | | | | | | | | Currently there is a problem on partition creation for MBR case. If disk exceeds 2TB, partition creation fails because we are hitting max msdos limit. Detect total disk size, and if it exceeds that limit, create the partition at the end of legal limits. Fixes-Bug: #1517077 Change-Id: I11dd3f11eaa6af764151b442768d10289ced6d3f
* Fixes config drive creation failure in UEFI boot modeShivanand Tendulker2015-09-231-6/+36
| | | | | | | | | | | This fix enables creation of config drive for UEFI only whole disk images. It will not work with the hybrid images that support booting in BIOS and UEFI boot mode. Change-Id: Ib4dd8c082a50e1dbaf0df91477b062716cb780ff Closes-Bug: #1486887 Depends-On: I81400305f166d62aa4612aab54602abb8178b64c
* Use host_device mode for qemu-imgMathieu Mitchell2015-06-181-1/+1
| | | | | | | | | When writing to a host device, possibly one that does not support holes, it is preferable to use host_device instead of the raw mode. Not doing so means holes are simply skipped and the deployed image is invalid. Change-Id: I24f8b4daf099af8bb03c3a4f6417b6c87bd49021 Closes-Bug: #1466632
* Add power_off command in standby extensionRamakrishnan G2015-06-091-1/+5
| | | | | | | | | | | This commit adds a new command power_off to standby extension which runs shutdown -h now on the system. This commit also adds mappings for /proc and /sys in cloud-config.yml for the agent service spawned. Partial-Bug: #1451310 Change-Id: I2a5f984af26bbbe03002bb8c367c8c6af8d91434
* Make sure sysrq functions are enabled in reboot.shRamakrishnan G2015-06-021-0/+3
| | | | | | | | This commit echoes '1' to >/proc/sys/kernel/sysrq to make sure that sysrq functions are enabled before invoking them. Change-Id: I88697efbc1bd0dec5ed4cbcd8d89b0b5d0734bdd
* Call partprobe+partx before writing configdriveJay Faulkner2015-03-191-0/+6
| | | | | | | | | | | | partx -u $DEVICE doesn't work in some cases, but partprobe $DEVICE fails in virtual environments (like devstack). For now, run both commands and ignore partprobe failures. Moving forward, this shell should be factored into python and share code with the other partition-modifying code added this cycle. Change-Id: I7e4c010e260be2a23dcc894bc0c1b30aea949084 Partial-bug: 1433812
* Use partx to update partition tableJim Rollenhagen2015-02-061-2/+2
| | | | | | | | partprobe does not appear to work in virtual machines. Let's find out if `partx -u` does the same thing and also works on virt. Change-Id: I4467299a82e728930ac8f99a0ba16d3ea7c6755c Closes-Bug: #1418833
* Write image directly to diskMathieu Mitchell2014-10-201-9/+3
| | | | | | | | | | | | Write image directly to disk by telling qemu-img that the output file is the disk. Still uses O_DIRECT directly within qemu-img. This avoids the need to have a huge amount of system memory to be able to deploy an image that contains a huge disk. The only feature left behind by that commit is the 64K block size. Change-Id: If60bcd82581b2ea76c4acbc3eaa3f317d2ee6590
* Fix comments to reflect realityJay Faulkner2014-06-202-3/+4
| | | | | | | | These comments were left in write_image.sh from the 'teeth-agent' days when these were split into two scripts. I moved the comment into the correct script and clarified what it means. Change-Id: Iccdcd925be5c94d993d8125534264f496de4594f
* Merge "Fix: partitions recently imaged not being detected"Jenkins2014-06-161-0/+4
|\
| * Fix: partitions recently imaged not being detectedJay Faulkner2014-06-111-0/+4
| | | | | | | | | | | | | | | | When we have just written out a whole disk image, if we do not run partprobe none of the new partitions show up in blkid, therefore even images with a built-in configdrive partition will have one created Change-Id: I6ec98dc237b42bfe94ce79cf84d155332335c9f6
* | Merge "Perform manual error checks instead of set -e"Jenkins2014-06-161-5/+9
|\ \ | |/
| * Perform manual error checks instead of set -eJay Faulkner2014-06-101-5/+9
| | | | | | | | | | | | | | | | | | | | When using set -e, if you have a command fail, even when setting a variable, it causes the node to fail. I have removed set -e and checked error state where unexpected everywhere. I also added additional logging. Closes-Bug: #1326326 Change-Id: I7d2568c3693b9c486672e4322c7f01622aeba875
* | Fix incorrect log statementJay Faulkner2014-06-121-1/+1
|/ | | | | | | Logging statement says it's 'imaging' to RAW, when in reality it's a conversion. Change-Id: I80d112062f51a6ccc932aeb71ec05042edb09884
* Allow configdrive partition to be precreatedJay Faulkner2014-06-031-9/+15
| | | | | | | | | | This adds support for copying configdrives to disks that already have partitions enabled and labeled for configdrives. This is neccessary for supporting configdrives on partitioning schemes we don't support yet (like GPT) or for some future agent iteration where we create partitions separately. Change-Id: Iee5b87d82be08febc495aaef3272ced4f2f32235
* Accept new parameters for `prepare_image`Jim Rollenhagen2014-04-241-18/+7
| | | | | | | | | | | | | | | | | | The parameters sent to `prepare_image` changed in https://review.openstack.org/#/c/86490/ This patch brings `prepare_image` up to date with that change. It also changes the way configdrive is written to disk, to match that Ironic is now allowing Nova to build an ISO partition and send the raw image to the agent. This patch also swaps out subprocess.call for processutils.execute in the standby module, since the commands were being changed anyway. Lastly, this patch changes the expected `hashes` dict to be a string parameter called `checksum`, to match what glance returns. Change-Id: Id8af9be920ba51e7e1ce60f4ffd1477e413582c9
* Use # instead of """ for copyright blocksJim Rollenhagen2014-04-104-15/+42
| | | | | | | Reformats copyright messages to be comments rather than docstring-style blocks. Change-Id: I4d863f53b67bb49d03bda0952b9e6179b6d23c59
* Replacing teeth/overlord with ipa/ironicJosh Gachnang2014-03-191-1/+1
|
* Renaming to IPAJosh Gachnang2014-03-194-0/+109