Skip to content

Importing from VMWare should show error for 'Not enough space in selected storage to import VM' #8298

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

Open
sawyerball opened this issue Feb 3, 2025 · 1 comment

Comments

@sawyerball
Copy link

Are you using XOA or XO from the sources?

XO from the sources

Which release channel?

None

Provide your commit number

494ea

Describe the bug

When importing a VM from VMWare, I kept getting an error that would just tell me 'Premature close'. After spending quite a bit of team looking around on both ends of the import, I realized that I was importing to a disk that did not have enough space for the VM. After switching the storage location, it worked just fine. A lot of time would have been saved had the error message contained an appropriate message.

Error message

{
  "id": "0m6o9hwmf",
  "properties": {
    "method": "vm.importMultipleFromEsxi",
    "params": {
      "concurrency": 2,
      "host": "* obfuscated *",
      "network": "* obfuscated *",
      "password": "* obfuscated *",
      "sr": "* obfuscated *",
      "sslVerify": false,
      "stopOnError": true,
      "stopSource": false,
      "template": "* obfuscated *",
      "user": "* obfuscated *",
      "vms": [
        "16"
      ]
    },
    "name": "API call: vm.importMultipleFromEsxi",
    "userId": "* obfuscated *",
    "type": "api.call"
  },
  "start": 1738539444327,
  "status": "failure",
  "updatedAt": 1738539445304,
  "end": 1738539445304,
  "result": {
    "code": "ERR_STREAM_PREMATURE_CLOSE",
    "succeeded": {},
    "message": "Premature close",
    "name": "Error",
    "stack": "Error: Premature close\n    at ClientRequest.<anonymous> (node:internal/streams/pipeline:416:14)\n    at ClientRequest.emit (node:events:530:35)\n    at ClientRequest.patchedEmit [as emit] (/opt/xo/xo-builds/xen-orchestra-202502011950/@xen-orchestra/log/configure.js:52:17)\n    at TLSSocket.socketCloseListener (node:_http_client:467:9)\n    at TLSSocket.emit (node:events:530:35)\n    at TLSSocket.patchedEmit [as emit] (/opt/xo/xo-builds/xen-orchestra-202502011950/@xen-orchestra/log/configure.js:52:17)\n    at node:net:343:12\n    at TCP.done (node:_tls_wrap:648:7)\n    at TCP.callbackTrampoline (node:internal/async_hooks:130:17)"
  }

To reproduce

  1. Click on Import > From VMWare.
  2. Fill out the form to login to your VMWare instance
  3. Select an SR to import to and a VM from VMWare with a bigger size than is remaining on the SR.
  4. Fill out the rest of the form with appropriate information
  5. Error will appear with vague details

Image

Expected behavior

I would expect the message to say something along the lines of 'Please select an SR that is big enough for this VM.'

Screenshots

Image
(This one only displayed 't' which hadn't happened before. Usually it said 'Premature close.')

Image

Node

20.18.2

Hypervisor

XCP-ng 8.2.1

Additional context

No response

@sawyerball
Copy link
Author

Another thing to keep in mind is when it failed the import, VMWare would lock the VM files so I wasn't able to start the VM for about 20 minutes or so. This made troubleshooting take even longer.

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

No branches or pull requests

3 participants