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

./vmware.sh upload_ova : "error_type":"NOT_ALLOWED_IN_CURRENT_STATE" #7663

Closed
eugene-marchanka opened this issue Aug 23, 2023 · 4 comments · Fixed by #7666
Closed

./vmware.sh upload_ova : "error_type":"NOT_ALLOWED_IN_CURRENT_STATE" #7663

eugene-marchanka opened this issue Aug 23, 2023 · 4 comments · Fixed by #7666
Assignees
Milestone

Comments

@eugene-marchanka
Copy link

eugene-marchanka commented Aug 23, 2023

Bug Report

Description

Reopening #7651

./vmware.sh upload_ova fails on images v1.5.x with error:

Logs

$ ./vmware.sh upload_ova
ad933db4-09be-435b-845b-b3cf6d89bf10
[23-08-23 10:50:25] Uploading vmware-amd64.ovf... OK
[23-08-23 10:50:38] Uploading vmware-amd64.vmdk... OK
govc: 400 Bad Request: {"type":"com.vmware.vapi.std.errors.not_allowed_in_current_state","value":{"error_type":"NOT_ALLOWED_IN_CURRENT_STATE","messages":[{"args":["complete","ERROR","Error transferring file
 vmware-amd64.vmdk to ds:///vmfs/volumes/641337ca-f337b7b3-b0dd-00620b24a3b0//contentlib-ad933db4-09be-435b-845b-b3cf6d89bf10/85bfcbc9-662f-4631-a3cf-543ee69e927c/vmware-amd64_d43ec0de-b058-4e70-9f63-45eb4f1fcf34.vmdk?serverId=07cd1723-c320-4353-a9ea-42e13d588b01. 
Reason: IO error during transfer of ds:///vmfs/volumes/641337ca-f337b7b3-b0dd-00620b24a3b0//contentlib-ad933db4-09be-435b-845b-b3cf6d89bf10/85bfcbc9-662f-4631-a3cf-543ee69e927c/vmware-amd64_d43ec0de-b058-4e70-9f63-45eb4f1fcf34.vmdk?serverId=07cd1723-c320-4353-a9ea-42e13d588b01: 
Pipe closed"],"default_message":"The operation complete can not be invoked when the import session is in the ERROR state. 
Reason: Error transferring file vmware-amd64.vmdk to 
ds:///vmfs/volumes/641337ca-f337b7b3-b0dd-00620b24a3b0//contentlib-ad933db4-09be-435b-845b-b3cf6d89bf10/85bfcbc9-662f-4631-a3cf-543ee69e927c/vmware-amd64_d43ec0de-b058-4e70-9f63-45eb4f1fcf34.vmdk?serverId=07cd1723-c320-4353-a9ea-42e13d588b01. 
Reason: IO error during transfer of 
ds:///vmfs/volumes/641337ca-f337b7b3-b0dd-00620b24a3b0//contentlib-ad933db4-09be-435b-845b-b3cf6d89bf10/85bfcbc9-662f-4631-a3cf-543ee69e927c/vmware-amd64_d43ec0de-b058-4e70-9f63-45eb4f1fcf34.vmdk?serverId=07cd1723-c320-4353-a9ea-42e13d588b01: 
Pipe closed","id":"com.vmware.vdcs.cls-main.update_session_invalid_state_for_operation_reason"}]}}

Environment

  • Talos version: v1.5.x
  • Platform: VMWare vSphere 8, ESXi 8
@eugene-marchanka
Copy link
Author

The problem is in file names inside archive.
v1.4.x:

$ ls -la 1-4-8/
total 160536
drwxrwxr-x 2 test test     4096 Aug 23 11:45 .
drwxrwxr-x 5 test test     4096 Aug 23 11:53 ..
-rw-r--r-- 1 test test      167 Aug 10 11:41 disk.mf
-rw-r--r-- 1 test test     5773 Aug 10 11:41 disk.ovf
-rw-r--r-- 1 test test 82177024 Aug 10 11:41 disk.vmdk
-rw-rw-r-- 1 test test 82186240 Aug 10 12:00 vmware-amd64.ova

vs
v1.5.x:

$ ls -la 1-5-0/
total 162980
drwxrwxr-x 2 test test     4096 Aug 23 11:55 .
drwxrwxr-x 5 test test     4096 Aug 23 11:53 ..
-rw-r--r-- 1 test test      183 Aug 17 07:16 vmware-amd64.mf
-rw-rw-r-- 1 test test 83435520 Aug 17 07:51 vmware-amd64.ova
-rw-r--r-- 1 test test     5787 Aug 17 07:16 vmware-amd64.ovf
-rw-r--r-- 1 test test 83423744 Aug 17 07:16 vmware-amd64.vmdk

Solution:

  1. Download .ova image
  2. Extract tar -xvf vmware-amd64.ova
  3. Rename vmware-amd64.* to disk.*
  4. Edit disk.ovf: <File ovf:href="vmware-amd64.vmdk" ovf:id="file1" ovf:size="83417600"/> -> <File ovf:href="disk.vmdk" ovf:id="file1" ovf:size="83417600"/>
  5. shasum -a 256 disk.ovf
  6. Update disk.mf with new SHA from #5
  7. Compress everything back: tar -cvf vmware-amd64.ova disk.ovf disk.vmdk disk.mf
  8. export OVA_PATH=<path_to_new_vmware-amd64.ova>
  9. Try run ./vmware.sh upload_ova

@smira smira self-assigned this Aug 23, 2023
@smira smira added this to the v1.6 milestone Aug 23, 2023
@smira
Copy link
Member

smira commented Aug 23, 2023

@eugene-marchanka
Copy link
Author

successfully imported:
image

@smira
Copy link
Member

smira commented Aug 23, 2023

@eugene-marchanka thanks a lot, fix is coming, and it will be available in 1.5.2

smira added a commit to smira/talos that referenced this issue Sep 5, 2023
It looks like while our code accepted any random name for the contents
of `.ova`, it should be named `disk.*`.

Change the code accordingly.

Fixes siderolabs#7663

Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
(cherry picked from commit a28d72e)
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants