2014-04-01 18:50 GMT+02:00 Anders Ingemann <[email protected]>:

> On 1 April 2014 17:45, Arnaud Patard <[email protected]> wrote:
>
>> olivier sallou <[email protected]> writes:
>>
>> > Hi,
>>
>> Hi,
>>
>> > I just wanted to give a status on my depvts for bootstrap-vz for Azure.
>> >
>> > I can build at the moment a vhd disk file to be used as an image.
>> However i
>> > do not even reach (yet) the boot. Indeed, Azure requires an image disk
>> to
>> > be a multiple of 1024 bits.
>> > Though my partitions are multiple of 1024 bits, it seems that generated
>> > image is not fine for it....
>>
>> Unless it has changed, it's not 1024 bits, but it's 1MB. According to my
>> notes, I was getting this error message otherwise:
>> "The size must be a whole number (in MBs)."
>> [ with azure node js tool ]
>>
>> >
>> > For the moment I generate a raw image with Azure agent and convert it to
>> > vhd files.
>> > Indeed, kpartx seems to fail on vhd disks at grub install:
>> >
>> > Installing grub
>> > device-mapper: resume ioctl on vdc2 failed: Invalid argument
>> > create/reload failed on vdc2
>> > Command 'kpartx -a /dev/mapper/vdc' returned non-zero exit status 1
>>
>> You can create an image file understood by qemu (and other tools) in
>> order to install grub & co. Then, use something like that:
>> roundedsize=$((($size/(1024*1024)+1)*(1024*1024)))
>> qemu-img resize $image $roundedsize
>> qemu-img convert -o subformat=fixed -O vpc $image $vhd
>>
>
Thanks, I gonna try this

>
>> [ this code is a small part of
>> http://git.hupstream.com/?p=projects/azure-image.git;a=summary. I guess
>> it can be improved but at least it was working last time I used it ]
>>
>> Arnaud
>>
>>
>>
>> --
>> To UNSUBSCRIBE, email to [email protected]
>> with a subject of "unsubscribe". Trouble? Contact
>> [email protected]
>> Archive: https://lists.debian.org/[email protected]
>>
>>
> > roundedsize=$((($size/(1024*1024)+1)*(1024*1024)))
> ... or you could use my little Bytes class that handles byte units for
> you:
> https://github.com/andsens/bootstrap-vz/blob/f315915a73ed8b073741dc47bdf20eadbbe9aa57/common/bytes.py
> Just import with:
> from common.bytes import Bytes
> It can parse most normal formats for size specification.
>

I will have a look. I gonna try at first "manual" resizing/conversion to
validate image format and , I expect, boot. Then I will see to implement
this in the provider code.

Olivier


-- 

gpg key id: 4096R/326D8438  (keyring.debian.org)

Key fingerprint = 5FB4 6F83 D3B9 5204 6335  D26D 78DC 68DB 326D 8438

Reply via email to