Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Azure image requires VHD cookie with value "conectix" #111

Closed
msehnout opened this issue Nov 19, 2019 · 2 comments
Closed

Azure image requires VHD cookie with value "conectix" #111

msehnout opened this issue Nov 19, 2019 · 2 comments

Comments

@msehnout
Copy link
Contributor

msehnout commented Nov 19, 2019

When uploading the vhd image to Azure it fails to boot with this error message:

{
  "error": {
    "code": "InvalidParameter",
    "message": "The specified cookie value in VHD footer indicates that disk 'image.vhd' with blob https://golangimageuploads.blob.core.windows.net:8443/quickstart-6922813081684464493/image.vhd is not a supported VHD. Disk is expected to have cookie value 'conectix'.",
    "target": "disks"
  }
}

more info: https://support.microsoft.com/en-us/help/4053292/conectix-error-and-uploaded-vhd-is-not-supported-when-you-create-a-vm

@msehnout
Copy link
Contributor Author

This can be fixed using the tutorial available at Microsoft support:

rawdisk="MyLinuxVM.raw"
vhddisk="MyLinuxVM.vhd"
MB=$((1024*1024))
size=$(qemu-img info -f raw --output json "$rawdisk" | gawk 'match($0, /"virtual-size": ([0-9]+),/, val) {print val[1]}')
rounded_size=$((($size/$MB + 1)*$MB))
echo "Rounded Size = $rounded_size"
qemu-img resize MyLinuxVM.raw $rounded_size
qemu-img convert -f raw -o subformat=fixed,force_size -O vpc MyLinuxVM.raw MyLinuxVM.vhd

Such image can be imported as a VM image into Azure.

@joshspicer
Copy link

more detail on how to do this on MacOS/Linux can be found in the msft docs: https://docs.microsoft.com/en-us/azure/virtual-machines/linux/create-upload-generic#resizing-vhds

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants