Bug 12445 - Fresh installation stuck 8 minutes at boot on Hyper-V 2016
Summary: Fresh installation stuck 8 minutes at boot on Hyper-V 2016
Status: CLOSED FIXED
Alias: None
Product: IPFire
Classification: Unclassified
Component: --- (show other bugs)
Version: 2
Hardware: other Windows
: Will affect almost no one Crash
Assignee: Thomas Void
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-06-26 20:47 UTC by Thomas Void
Modified: 2022-03-02 20:34 UTC (History)
2 users (show)

See Also:


Attachments
Screenshot_first_boot (49.18 KB, image/png)
2020-06-26 20:47 UTC, Thomas Void
Details
Syslog (8.68 KB, text/plain)
2020-06-26 20:49 UTC, Thomas Void
Details
dhclient stuck after DHCPACK (64.43 KB, image/png)
2020-06-26 23:29 UTC, Thomas Void
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Void 2020-06-26 20:47:00 UTC
Created attachment 767 [details]
Screenshot_first_boot

Fresh installation of IPFire 2.25 (x86_64) on Hyper-V Server 2016 1607 (Gen1 VM) stuck 8 minutes during boot after the line "Setting up Pakfire Package Manager..."

Probably due to a bug in the detection of MS Azure routine running_on_azure() in the init script /etc/rc.d/init.d/functions

I already investigated the problem a little bit in the forum post: https://community.ipfire.org/t/fresh-installation-stuck-8-minutes-at-boot/2579/4

See also https://bugzilla.ipfire.org/show_bug.cgi?id=12272

Workaround: Ctrl+C to abort the running script during the boot.
Comment 1 Thomas Void 2020-06-26 20:49:04 UTC
Created attachment 768 [details]
Syslog
Comment 2 Thomas Void 2020-06-26 23:29:24 UTC
UPDATE:
It seems that dhclient called in /etc/init.d/cloud-init get stuck.
dhclient is called with the -sf /etc/rc.d/helper/azure-setup param.

When I remove the -sf param everything works fine. The interface gets an IP address and continues. However with the -sf param, dhclient get stuck after DHCPACK. So either there is a bug in the dhclient (couldn't find any information regarding version 4.4.1) or there is someting wrong with the azure script.

The censored red box in the attached screenshot shows my correct public IP address on red0. That means that until this point everything works as expected and dhclient is receiving an IP address.

I tried to debug the azure script but I'm not familiar with dhclient script option and what it does and also with the internal structure of ipfire and it's init scripts.

I also signed up for an trial version of Azure but installing an VM with an custom ISO is way more complicated than i thougth. It'll take me at least a weekend to read up on Azure, documentation and so on...

So i hand over to people who are smarter than me.
Comment 3 Thomas Void 2020-06-26 23:29:58 UTC
Created attachment 769 [details]
dhclient stuck after DHCPACK
Comment 4 Michael Tremer 2020-06-29 15:17:51 UTC
Hey Thomas,

this is an interesting problem.

Those script are executed because the system thinks that it is running on Azure, which probably isn't true in your case. I have no reliable way to distinguish between Hyper-V on-premise or Hyper-V in Microsoft's cloud.

Removing the script obviously breaks the cloud setup process.

We already added an exit if we do not get an Id:

> https://git.ipfire.org/?p=ipfire-2.x.git;a=commitdiff;h=26eab1fe3e5ed74013420e077a112a012eeab4f6

I assume it is the wget call. Could you try adding some timeout of about a second and test that?
Comment 5 Thomas Void 2020-07-03 23:34:52 UTC
Good evening Michael,

I played a bit around with the trial version of Azure and didn't find an reliable way either.

I fixed the problem with the --timeout option at the wget line. You were right. Strangely enough wget is taking way to long if the IP 169.254 isn't reachable. I don't know if this is a normal behavior or something gets messed up because normally you get the IP 169.254 when there is no DHCP Server available. IMHO stupid idea from MS to take this IP for it's internal metadata service.

Anyways I'll prepare my git repo and send out the diff with the fix soon.


Greetings
Thomas
Comment 6 Michael Tremer 2020-07-04 09:28:41 UTC
(In reply to Thomas Void from comment #5)
> Anyways I'll prepare my git repo and send out the diff with the fix soon.

Perfect! Thank you.
Comment 7 Thomas Void 2020-11-06 22:28:19 UTC
I just stumbled upon this post https://community.ipfire.org/t/hyper-v-gen-2-vm-installation/1046/22

Here is the fix I posted at the dev mailing list.

https://lists.ipfire.org/pipermail/development/2020-July/008007.html

I'm truly sorry about the messed up subject. I mixed up some command line arguments, it was really late at night...sorry


This should fix the problem. Also thank you Michael Tremer for the help.

Please merge into next.

Thank you
Tom
Comment 8 Thomas Void 2021-04-01 23:08:15 UTC
My first Patch didn't find it's way to patchwork because of an wrong and way to long subject.

So I resubmitted it. Michael Tremer had also the idea to change the values for timeout/tries from 10/1 to 3/3


https://patchwork.ipfire.org/patch/4089/


Tom
Comment 9 Thomas Void 2021-04-01 23:10:33 UTC
btw. here is the first patch with the comment from Michael
https://patchwork.ipfire.org/patch/4007/
Comment 11 Peter Müller 2022-03-02 20:34:44 UTC
I assume this issue has been fixed by the release of the aforementioned patch, therefore closing this. Please reopen, if necessary.