disk-creation not working with latest sfdisk

Bug #1577346 reported by Sebastian on 2016-05-02
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
ganeti-instance-debootstrap (Ubuntu)
Undecided
Unassigned

Bug Description

After updating from 14.04 to 16.04 I haven't been able to create any new instances with OS-type ganeti-debootstrap.

Due to sfdisk having dropped the -C, -H, -S and --Linux options, instance creation always broke with the following error at "running OS creation scripts":
"sfdisk: invalid option -- 'H'"

sfdisk: --Linux option is unnecessary and deprecated

I was able to 'fix' it (badly, yes) by removing the options from the common.sh script:

/usr/share/ganeti/os/debootstrap/common.sh
94c94
< sfdisk -u S --force --quiet "$1" <<EOF
---
> sfdisk -H 64 -S 32 -u S --quiet --Linux "$1" <<EOF

I had to add '--force' due to sfdisk complaining that the disk might be in use:

This disk is currently in use - repartitioning is probably a bad idea.
Umount all file systems, and swapoff all swap partitions on this disk.
Use the --no-reread flag to suppress this check.

As I consider this a rather dirty fix, somebody might take a look at possible side-effects with --force and the removed geometry options.

Thanks!!

---
Additional information:

> cat /etc/issue
Ubuntu 16.04 LTS

> apt-cache policy ganeti-instance-debootstrap
ganeti-instance-debootstrap:
  Installiert: 0.15-2
  Installationskandidat: 0.15-2
  Versionstabelle:
 *** 0.15-2 500
        500 http://mirror.manage/ubuntu xenial/universe amd64 Packages
        500 http://mirror.manage/ubuntu xenial/universe i386 Packages
        100 /var/lib/dpkg/status

> sfdisk -v
sfdisk from util-linux 2.27.1

> gnt-cluster version
Software version: 2.15.2
Internode protocol: 2150000
Configuration format: 2150000
OS api version: 20
Export interface: 0
VCS version: (ganeti) version 2.15.2-3

spbike (bill-broadley) wrote :

This bit me on 15.10 and 16.04. My fix is very similar:
- sfdisk -H 255 -S 63 --quiet --Linux "$1" <<EOF
 -0,,L,*
 + sfdisk --quiet --force "$1" << EOF
 +;

It works for me. I issued a pull request on the upstream package quite awhile ago and haven't gotten a response. With the change it seems to work well for me.

Iustin Pop (iustin) wrote :

I fixed this today upstream (with a backwards compatible fix). This will get into Debian as soon as a new release is made, and then can be patched in existing Ubuntu LTS (but I don't know how that process works exactly).

I'm attaching the patch in the meantime here; if you can confirm it works, that would be good; I tested with sfdisk 2.28 from Debian unstable.

Changed in ganeti-instance-debootstrap (Ubuntu):
status: New → Confirmed

The attachment "Fix sfdisk invocation for util-linux 2.26+" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch

Hi Iustin,

On 20:32 Thu 26 May , Iustin Pop wrote:
> I fixed this today upstream (with a backwards compatible fix). This will
> get into Debian as soon as a new release is made, and then can be
> patched in existing Ubuntu LTS (but I don't know how that process works
> exactly).
>
> I'm attaching the patch in the meantime here; if you can confirm it
> works, that would be good; I tested with sfdisk 2.28 from Debian
> unstable.

Thanks for the fix! Do you plan to release 0.16 soon, or should I apply
the patches on top of the 0.15 Debian package?

Regards,
Apollon

Iustin Pop (iustin) wrote :

Oh, hi Apollon!

Yes, I do plan to release 0.16; I only need to get in some more cleanup patches.

Also, it really bothers me that we didn't catch this before hand [in Debian], so I'll try to add an autopkg test that checks basic instance creation.

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ganeti-instance-debootstrap - 0.16-1

---------------
ganeti-instance-debootstrap (0.16-1) unstable; urgency=medium

  * New upstream release:
    + Fix compatibility with sfdisk >= 2.26 (LP: #1577346)
  * Run upstream's install-export-import test as a DEP-8 test. Note that we
    require isolation-machine for the test to work, as it needs access to
    /dev/loop*.
  * Use dh-autoreconf, as upstream stopped shipping automake'd tarballs
    + B-D on debootstrap, kpartx and dump for automake to find them.
  * Bump standards to 3.9.8; no changes needed.

 -- Apollon Oikonomopoulos <email address hidden> Wed, 01 Jun 2016 12:30:01 +0300

Changed in ganeti-instance-debootstrap (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers