Bug 33460 - UCC roll out fails if underlying (virtual/RAID) harddisk was resized
UCC roll out fails if underlying (virtual/RAID) harddisk was resized
Status: CLOSED WONTFIX
Product: Z_Univention Corporate Client (UCC)
Classification: Unclassified
Component: General
unspecified
Other Linux
: P5 normal
: UCC 2.0
Assigned To: Felix Botner
Moritz Muehlenhoff
: interim-3
: 34042 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-11-18 16:20 CET by Daniel Orrego
Modified: 2014-06-12 09:19 CEST (History)
2 users (show)

See Also:
What kind of report is it?: ---
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Orrego univentionstaff 2013-11-18 16:20:16 CET
It happened during an UCC desktop roll out on a virtual machine.

The first roll out attempt the HD space was not enough, so the roll out failed and I increased the size of the virtual disk.

All following attempts, the roll out will fail:

      "The boot failed. Please contact your system administrator.
      Add debugshell=y to the boot parameters to get a debug shell.
      Press enter to reboot!"

*Reason:
Since a GPT partition was already created the first time, and the disk sized changed after that (moving the GPT header), 'parted' will fail to create the partitions (even when forced) with the following message:

        "Not all of the space available to /dev/sda appears to be used, you can fix the GPT to use all of the space (an extra X blocks) or continue with the current setting?"


*Solution:
(http://www.novell.com/support/kb/doc.php?id=7006405)
**add 'debugshell=yes' as an "Additional boot parameter" in UMC
and once you have a shell:
**Get 'parted' to report the error again:
# parted -l
Warning: Not all of the space available to /dev/sda appears to be used, you can fix the GPT to use all of the space (an extra X blocks) or continue with the current setting?
Fix/Ignore
**Write "FIX" and press 'Enter' key

Try the roll out again.
Comment 1 Felix Botner univentionstaff 2014-05-08 11:37:44 CEST
Yes, that is true. If i create a virtual machine with a small hard disk image (100MB) i get an error during partitioning. After resizing the image file with

-> qemu-img resize fbotner_ucc-3-0.qcow2 +3000M

the partitioning still fails ("Not all of the space available to /dev/sda appears to be used, you can fix the GPT to use all of the space (an extra X blocks) or continue with the current setting?").

The reason is, we don't always create the GPT table, only if none exists.

  pt="$(/sbin/parted -s ${partition_device} unit MB print | sed -ne...
  if [ "$pt" != "gpt" ]; then
    debug "Partition table on ${partition_device} is not gpt."
    notice "Creating GPT on ${partition_device}"
    parted -s "${partition_device}" mklabel GPT
  fi

So during the first run (with the small hard disk image), the GPT table is created. In the second run (with the resized image) the table is not rewritten. This causes the mismatch between the old GPT table and the new (resized) hard disk.

After recreating the GPT tabel with "parted -s "${partition_device}" mklabel GPT" the problem is gone.

But we can not simply always create the GPT table during partitioning as this would break the "remove_partitions" option from the image ini (all partitions are lost after (re)creating the GTP table).

Best we wait for bug #34774 to rethink the whole partitioning process.
Also, this is very hypothetical as normal ucc clients are not virtual machines (with the option to resize the hard disk)
Comment 2 Moritz Muehlenhoff univentionstaff 2014-05-08 12:40:11 CEST
Agreed, a cleaner solution can be implemented with Bug #34774, for UCC 2.0 we'll document this.
Comment 3 Moritz Muehlenhoff univentionstaff 2014-05-08 13:10:55 CEST
*** Bug 34042 has been marked as a duplicate of this bug. ***
Comment 4 Moritz Muehlenhoff univentionstaff 2014-06-12 09:19:55 CEST
UCC 2.0 has been released:
 http://docs.univention.de/release-notes-ucc-2.0.html

If this error occurs again, please use "Clone This Bug".