Project

General

Profile

Bug #67944

Make sure the required directory structure exists when creating a VM

Added by Dan Bright almost 2 years ago. Updated almost 2 years ago.

Status:
Done
Priority:
No priority
Assignee:
William Grzybowski
Category:
Middleware
Target version:
Severity:
Low Medium
Reason for Closing:
Reason for Blocked:
Needs QA:
No
Needs Doc:
No
Needs Merging:
No
Needs Automation:
No
Support Suite Ticket:
n/a
Hardware Configuration:
ChangeLog Required:
No
Tags:

Description

When attempting to create a new Virtual Machine using the "Docker Host" wizard type, the process fails with the following error:

[EFAULT] Failed to download http://download.freenas.org/bhyve-templates/rancheros-bhyve-v1.4.2/rancheros-bhyve-v1.4.2.img.gz (retries=3)

No errors are logged in either /var/log/messages or /var/log/middlewared.log.

The associated URL is accessible from the same machine (for example, the image may be downloaded from the above URL through curl/wget on the CLI).

Steps to reproduce:

  • Select Virtual Machines from the left sidebar, then click the "+" icon to add a new VM
  • Select "Docker Host" wizard type and continue through the wizard, selecting defaults options (and names/paths as appropriate), to configure the new VM
  • At the final screen of the wizard, click the "Submit" button. A modal will now pop up (at least, on my machine), containing the above error message.

Related issues

Copied to FreeNAS - Bug #68221: Creating Virtual Machine fails when RancherOS image download failsDone

Associated revisions

Revision 03ef357a (diff)
Added by William Grzybowski almost 2 years ago

fix(middlewared/vm): make sure the dir structure exists when creating VM Ticket: #67944

Revision c81e1095 (diff)
Added by William Grzybowski almost 2 years ago

fix(middlewared/vm): make sure the dir structure exists when creating VM Ticket: #67944 (cherry picked from commit 03ef357a508ae5c5dd0cf014cb45092d3552a257)

Revision a8588c9d (diff)
Added by William Grzybowski almost 2 years ago

fix(middlewared/vm): make sure the dir structure exists when creating VM Ticket: #67944 (cherry picked from commit 03ef357a508ae5c5dd0cf014cb45092d3552a257)

History

#1 Updated by Dru Lavigne almost 2 years ago

  • Private changed from No to Yes
  • Reason for Blocked set to Need additional information from Author

Dan: please reproduce then attach a debug (System -> Advanced -> Save debug) to this ticket.

#2 Updated by Dan Bright almost 2 years ago

Dru Lavigne wrote:

Dan: please reproduce then attach a debug (System -> Advanced -> Save debug) to this ticket.

Sure, are there any particular pertinent files I could pull from that debug archive? There's a lot there, and I'll need to check over anything I upload first for personal information (GDPR requirements - I've got business data on the NAS).

#3 Updated by Dru Lavigne almost 2 years ago

  • Assignee changed from Release Council to William Grzybowski

/var/log/messages and /var/log/middlewared.log are good to start with. The dev may request more info if that is not enough to diagnose the issue.

#4 Updated by William Grzybowski almost 2 years ago

  • Status changed from Unscreened to Blocked
  • Target version changed from Backlog to 11.2-U2
  • Severity changed from New to Low Medium

Do you have any UNIX experience?

Are you able to try to make the following change:

@@ -1248,7 +1248,7 @@ class VMService(CRUDService):
                 self.__fetch_image(container_image['URL'], file_path, job)
                 break
             except Exception:
-                pass
+                self.logger.debug('Failed to fetch (retry=#%d)', retry + 1, exc_info=True)
         else:
             raise CallError(f'Failed to download {container_image["URL"]} (retries={retry + 1})')

to /usr/local/lib/python3.6/site-packages/middlewared/plugins/vm.py

Reboot and then try again (and attach middlewared.log ig happens again)

#5 Updated by Dan Bright almost 2 years ago

  • File middlewared.log added

Hi William,

Yes, some experience with FreeBSD, more on Linux (also Python, with a smattering of Angular). So, happy to assist with this where I can.

I've patched as requested, the issue persists after rebooting. However, the error does now show up in the middlewared.log, as expected (please see attached).

#6 Updated by William Grzybowski almost 2 years ago

Thanks, thats helpful.

Do you have a dataset created and mounted in /mnt/aninstancedatacenter/.bhyve_containers ?

#7 Updated by Dan Bright almost 2 years ago

William Grzybowski wrote:

Do you have a dataset created and mounted in /mnt/aninstancedatacenter/.bhyve_containers ?

Yes, there is; zfs list -r aninstancedatacenter/.bhyve_containers yields:

NAME                                     USED  AVAIL  REFER  MOUNTPOINT
aninstancedatacenter/.bhyve_containers   128K  4.42T   128K  /mnt/aninstancedatacenter/.bhyve_containers

#8 Updated by William Grzybowski almost 2 years ago

Can you paste

ls -la /mnt/aninstancedatacenter/.bhyve_containers ?

Does it have a iso_files folder?

#9 Updated by Dan Bright almost 2 years ago

William Grzybowski wrote:

Can you paste

ls -la /mnt/aninstancedatacenter/.bhyve_containers ?

Does it have a iso_files folder?

The .bhyve_containers directory is empty, there's no iso_files

#10 Updated by William Grzybowski almost 2 years ago

Dan Bright wrote:

William Grzybowski wrote:

Can you paste

ls -la /mnt/aninstancedatacenter/.bhyve_containers ?

Does it have a iso_files folder?

The .bhyve_containers directory is empty, there's no iso_files

Can you try creating one and verify if that fixes the problem? Thats likely the issue we will figure out why its not being created automatically.

#11 Updated by Dan Bright almost 2 years ago

William Grzybowski wrote:

The .bhyve_containers directory is empty, there's no iso_files

Can you try creating one and verify if that fixes the problem? Thats likely the issue we will figure out why its not being created automatically.

Yes! Success. Thanks!

#12 Updated by Bug Clerk almost 2 years ago

  • Status changed from Blocked to In Progress

#14 Updated by William Grzybowski almost 2 years ago

  • Reason for Blocked deleted (Need additional information from Author)

#15 Updated by Bug Clerk almost 2 years ago

  • Status changed from In Progress to Ready for Testing

#16 Updated by Bug Clerk almost 2 years ago

  • Copied to Bug #68221: Creating Virtual Machine fails when RancherOS image download fails added

#17 Updated by Dru Lavigne almost 2 years ago

  • File deleted (middlewared.log)

#18 Updated by Dru Lavigne almost 2 years ago

  • Subject changed from Creating Virtual Machine fails when RancherOS image download fails to Make sure the required directory structure exists when creating a VM
  • Private changed from Yes to No
  • Needs Doc changed from Yes to No
  • Needs Merging changed from Yes to No

#20 Updated by Jeff Ervin almost 2 years ago

  • Status changed from Ready for Testing to Passed Testing
  • Needs QA changed from Yes to No

Test Passed FreeNAS-11.2-INTERNAL77

Per test case: Created Docker VM, deleted Docker VM, ran "rm -rf /mnt/Picard/.bhyve_containers", created another Docker VM successfully.

#21 Updated by Dru Lavigne almost 2 years ago

  • Status changed from Passed Testing to Done

Also available in: Atom PDF