grub_proc.communicate timeout is too short at 2 seconds

Description

Some VMs I have failed to start on initial boot up of the server with:

"grub-bhyve timed out, please check your grub config."

Even though the timeout in the grub file for the VM is set to 0

If the VM is manually started after FreeNAS is up, there is no problem booting the system.

It appears that the 2s second time out is to low and should be a bit higher.

The fix is to change line 280 of:
`/usr/local/lib/python3.7/site-packages/middlewared/plugins/vm.py`

from 2 seconds:
```

```python
try:
await asyncio.wait_for(self.grub_proc.communicate(), 2)
```

to 5 seconds:

```python
try:
await asyncio.wait_for(self.grub_proc.communicate(), 5)
```

Could we get this minor change into the next update?

Problem/Justification

None

Impact

None

SmartDraw Connector

Katalon Manual Tests (BETA)

Activity

Vincent Royer 
April 7, 2020 at 12:19 AM

so any way to run my vm without waiting for U2?

Waqar 
April 6, 2020 at 11:43 PM

the fix would be available in U2 ; )

Vincent Royer 
April 6, 2020 at 11:30 PM

This is odd, the fix seems to not be working for one of my vms. 

11.3U1

Error: Traceback (most recent call last): File "/usr/local/lib/python3.7/site-packages/middlewared/plugins/vm.py", line 280, in run await asyncio.wait_for(self.grub_proc.communicate(), 5) File "/usr/local/lib/python3.7/asyncio/tasks.py", line 449, in wait_for raise futures.TimeoutError() concurrent.futures._base.TimeoutError During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/local/lib/python3.7/site-packages/middlewared/main.py", line 130, in call_method io_thread=False) File "/usr/local/lib/python3.7/site-packages/middlewared/main.py", line 1077, in _call return await methodobj(*args) File "/usr/local/lib/python3.7/site-packages/middlewared/schema.py", line 961, in nf return await f(*args, **kwargs) File "/usr/local/lib/python3.7/site-packages/middlewared/plugins/vm.py", line 1012, in start await self._manager.start(vm) File "/usr/local/lib/python3.7/site-packages/middlewared/plugins/vm.py", line 53, in start list(done)[0].result() File "/usr/local/lib/python3.7/site-packages/middlewared/plugins/vm.py", line 287, in run raise CallError('grub-bhyve timed out, please check your grub config.') middlewared.service_exception.CallError: [EFAULT] grub-bhyve timed out, please check your grub config.

 

Bug Clerk 
March 10, 2020 at 10:17 AM

stephen gelardi 
March 9, 2020 at 10:11 PM

you will see alot of entries in middlewared.log up until I fixed the issue.

 

E.g.

 

middlewared.log:[2020/03/07 22:50:59] (DEBUG) middlewared.start_on_boot():1214 - Failed to start VM RancherOS: [EFAULT] grub-bhyve timed out, please check your grub config.

Complete

Details

Assignee

Reporter

Components

Fix versions

Affects versions

Priority

More fields

Katalon Platform

Created March 7, 2020 at 10:08 PM
Updated July 1, 2022 at 4:50 PM
Resolved March 10, 2020 at 10:17 AM