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 vmunbundle to allow 'vmadm receive' to have raw JSON parsed to it #487

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

davefinster
Copy link

According to https://github.com/joyent/smartos-live/blob/master/src/vm/README.migration, it should be possible to pipe the JSON output of vmadm get into vmadm receive (once the ZFS datasets are moved across) to re-install the zone. In practice, when attempted on joyent_20150903T073920Z (and seemingly since inception as the logic hasn't changed) vmadm receive will fail with 'Failed to get JSON!'.

This is because the condition in VM.js receiveStdinChunk requires a chunk name and size to be provided by vmunbundle. When raw JSON is passed into vmunbundle, it fails to find the 'magic header' that vmadm send generates so it dumps the raw JSON and exits prior to printing the chunk_name and chunk_size. These two parameters don't actually get calculated as they are pulled from the header.

This change simply provides the data expected by VM.js in the case of raw JSON being used. Looking at the comments in vmunbundle the intention seems to have been there.

…ocessing raw JSON. This is required to allow VM.js receive to function when passed raw JSON instead of the output of vmadm send
@matthiasg
Copy link

will this ever be fixed ?

@teotikalki
Copy link

I came here because my SmartOS host suffered a hardware failure and I am attempting to restore from backups. What I seem to have found is that even though I HAVE backups they CANNOT be restored. WTF?!
This is a CRITICAL FAILING... so WHY is it that there is a pull request to fix it that is 5 year old.

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.

3 participants