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

Fix azure #210

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

Fix azure #210

wants to merge 2 commits into from

Conversation

jimmykarily
Copy link
Contributor

To fix this error:

Message: The specified cookie value in VHD footer indicates that disk 'kairos-ubuntu-24.04-core-amd64-generic-3.3.1-88-g70ebc315.raw.vhd' with blob https://kairoscloudimages.blob.core.windows.net:8443/kairos-cloud-images/kairos-ubuntu-24.04-core-amd64-generic-3.3.1-88-g70ebc315.raw.vhd is not a supported VHD. Disk is expected to have cookie value 'conectix'.

Signed-off-by: Dimitris Karakasilis <[email protected]>
Thus we don't have to remove 512 bytes (the "footer"/header size). We
just round the file up and we add the footer in the end.

Signed-off-by: Dimitris Karakasilis <[email protected]>
Copy link

codecov bot commented Mar 7, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 14.02%. Comparing base (1c68230) to head (be87a6e).
Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #210      +/-   ##
==========================================
- Coverage   14.29%   14.02%   -0.27%     
==========================================
  Files          11       11              
  Lines        1749     1775      +26     
==========================================
- Hits          250      249       -1     
- Misses       1483     1510      +27     
  Partials       16       16              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@@ -44,8 +45,6 @@ func Raw2Azure(source string) (string, error) {
var finalSize int64
// Calculate the final size in bytes
finalSize = ((actualSize + constants.MB - 1) / constants.MB) * constants.MB
finalSize -= 512
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this is what its breaking it? what out because IIRC the checksum is calculated based on the size or something like that? I know I added it somehow for a checksum reason or something like that?

Well, if it works, it works :D

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yup, trial and error :D

@@ -88,7 +87,7 @@ func Raw2Azure(source string) (string, error) {
}
sizeFile := fileInfo.Size()

if sizeFile%constants.MB != 0 {
if int64(size)%constants.MB != 0 {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

size is the old size, but we are writing the header to the file afterwards, so the size has changed. Thats why it updates the stat before checking it, to get the actual real size on disk of it. Not sure if this is ok

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Azure wants the image size without the "footer" to be a multiple of MB so we don't need to subtract 512 (see the other change). This check becomes less important then, but I changed it anyway to make it work.

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

Successfully merging this pull request may close these issues.

2 participants