Skip to content
This repository has been archived by the owner on Jan 1, 2021. It is now read-only.

Boot2Docker kernel does not consistently recognize Hyper-V Network Adapter as a device #1311

Open
pldmgg opened this issue Mar 20, 2018 · 3 comments
Labels

Comments

@pldmgg
Copy link

pldmgg commented Mar 20, 2018

NOTE: For tracking purposes, be aware that I also copy-pasted this same issue in two other palces because I'm not sure of the appropriate place given the problem:

Envrionment Info:

  • Windows 1709
  • Windows PowerShell 5.1
  • Docker For Windows 17.12.0-ce-win47
  • boot2docker.iso that says it's using Docker version 17.12.1-ce, build 7390fc6

From PowerShell:

PS C:\Users\pdadmin> docker-machine create -d hyperv --hyperv-virtual-switch "ToInternal" DockerHostA
Creating CA: C:\Users\pdadmin\.docker\machine\certs\ca.pem
Creating client certificate: C:\Users\pdadmin\.docker\machine\certs\cert.pem
Running pre-create checks...
(DockerHostA) Image cache directory does not exist, creating it at C:\Users\pdadmin\.docker\machine\cache...
(DockerHostA) No default Boot2Docker ISO found locally, downloading the latest release...
(DockerHostA) Latest release for github.com/boot2docker/boot2docker is v17.12.1-ce
(DockerHostA) Downloading C:\Users\pdadmin\.docker\machine\cache\boot2docker.iso from https://github.com/boot2docker/boot2docker/releases/download/v17.12.1-ce/boot2docker.iso...
(DockerHostA) 0%....10%....20%....30%....40%....50%....60%....70%....80%....90%....100%
Creating machine...
(DockerHostA) Copying C:\Users\pdadmin\.docker\machine\cache\boot2docker.iso to C:\Users\pdadmin\.docker\machine\machines\DockerHostA\boot2docker.iso...
(DockerHostA) Creating SSH key...
(DockerHostA) Creating VM...
(DockerHostA) Using switch "ToInternal"
(DockerHostA) Creating VHD
(DockerHostA) Starting VM...
(DockerHostA) Waiting for host to start...

Docker-Machine hangs here. Using Hyper-V VM console (i.e. vmconnect.exe), I can see that during boot, boot2docker mentions that it can't find eth0 or eth1 (not sure why it says anything about eth1...there's only one Adapter attached to the VM, so there shoul only be an eth0 as far as I understand). While docker-machine continues to hang (after 80 seconds), here is the output of Get-VM Hyper-V cmdlet:

PS C:\Users\pdadmin> $testA = Get-VM -Name DockerHostA
PS C:\Users\pdadmin> $testA | fl *


ParentCheckpointId                  : 1a188696-c3ac-4ecf-b140-c08cf78b1db6
ParentCheckpointName                : Automatic Checkpoint - DockerHostA - (3/20/2018 - 12:12:00 PM)
VMName                              : DockerHostA
VMId                                : 6abb8e25-2bb1-4a7e-b19b-8d4dfc68a64b
CheckpointFileLocation              : C:\Users\pdadmin\.docker\machine\machines\DockerHostA\DockerHostA
ConfigurationLocation               : C:\Users\pdadmin\.docker\machine\machines\DockerHostA\DockerHostA
SmartPagingFileInUse                : False
SmartPagingFilePath                 : C:\Users\pdadmin\.docker\machine\machines\DockerHostA\DockerHostA
SnapshotFileLocation                : C:\Users\pdadmin\.docker\machine\machines\DockerHostA\DockerHostA
AutomaticStartAction                : StartIfRunning
AutomaticStartDelay                 : 0
AutomaticStopAction                 : Save
AutomaticCriticalErrorAction        : Pause
AutomaticCriticalErrorActionTimeout : 30
AutomaticCheckpointsEnabled         : True
CPUUsage                            : 0
MemoryAssigned                      : 912261120
MemoryDemand                        : 619708416
MemoryStatus                        : OK
NumaAligned                         : False
NumaNodesCount                      : 1
NumaSocketCount                     : 1
Heartbeat                           : OkApplicationsUnknown
IntegrationServicesState            :
IntegrationServicesVersion          : 0.0
Uptime                              : 00:03:12.6840000
OperationalStatus                   : {Ok}
PrimaryOperationalStatus            : Ok
SecondaryOperationalStatus          :
StatusDescriptions                  : {Operating normally}
PrimaryStatusDescription            : Operating normally
SecondaryStatusDescription          :
Status                              : Operating normally
ReplicationHealth                   : NotApplicable
ReplicationMode                     : None
ReplicationState                    : Disabled
ResourceMeteringEnabled             : False
CheckpointType                      : Standard
EnhancedSessionTransportType        : VMBus
Groups                              : {}
Version                             : 8.3
VirtualMachineType                  : RealizedVirtualMachine
VirtualMachineSubType               : Generation1
Notes                               :
State                               : Running
ComPort1                            : VMComPort (Name = 'COM 1', VMName = 'DockerHostA') [Id =
                                      'Microsoft:6ABB8E25-2BB1-4A7E-B19B-8D4DFC68A64B\8E3A359F-559A-4B6A-98A9-1690A6100ED7\0', VMId =
                                      '6abb8e25-2bb1-4a7e-b19b-8d4dfc68a64b']
ComPort2                            : VMComPort (Name = 'COM 2', VMName = 'DockerHostA') [Id =
                                      'Microsoft:6ABB8E25-2BB1-4A7E-B19B-8D4DFC68A64B\8E3A359F-559A-4B6A-98A9-1690A6100ED7\1', VMId =
                                      '6abb8e25-2bb1-4a7e-b19b-8d4dfc68a64b']
DVDDrives                           : {DVD Drive on IDE controller number 1 at location 0}
FibreChannelHostBusAdapters         : {}
FloppyDrive                         : VMFloppyDiskDrive (Name = 'Diskette Drive', VMName = 'DockerHostA') [Id =
                                      'Microsoft:6ABB8E25-2BB1-4A7E-B19B-8D4DFC68A64B\8F0D2762-0B00-4E04-AF4F-19010527CB93\0\0\D', VMId =
                                      '6abb8e25-2bb1-4a7e-b19b-8d4dfc68a64b']
HardDrives                          : {Hard Drive on IDE controller number 0 at location 0}
RemoteFxAdapter                     :
VMIntegrationService                : {Guest Service Interface, Heartbeat, Key-Value Pair Exchange, Shutdown...}
DynamicMemoryEnabled                : True
MemoryMaximum                       : 1099511627776
MemoryMinimum                       : 536870912
MemoryStartup                       : 1073741824
ProcessorCount                      : 1
BatteryPassthroughEnabled           : False
Generation                          : 1
IsClustered                         : False
ParentSnapshotId                    : 1a188696-c3ac-4ecf-b140-c08cf78b1db6
ParentSnapshotName                  : Automatic Checkpoint - DockerHostA - (3/20/2018 - 12:12:00 PM)
Path                                : C:\Users\pdadmin\.docker\machine\machines\DockerHostA\DockerHostA
SizeOfSystemFiles                   : 81920
GuestControlledCacheTypes           : False
LowMemoryMappedIoSpace              : 134217728
HighMemoryMappedIoSpace             : 536870912
LockOnDisconnect                    : Off
CreationTime                        : 3/20/2018 12:11:53 PM
Id                                  : 6abb8e25-2bb1-4a7e-b19b-8d4dfc68a64b
Name                                : DockerHostA
NetworkAdapters                     : {Network Adapter}
CimSession                          : CimSession: .
ComputerName                        : WIN10LATESTA
IsDeleted                           : False

...specifically note $testA.NetworkAdapters.StatusDescription and $testA.NetworkAdapters.Status ...

PS C:\Users\pdadmin> $testA.NetworkAdapters | fl *


VMCheckpointId                          : 00000000-0000-0000-0000-000000000000
VMCheckpointName                        :
VmmqQueuePairs                          : 1
VmmqQueuePairsRequested                 : 16
ClusterMonitored                        : True
MacAddress                              : 00155D020D0A
DynamicMacAddressEnabled                : True
InterruptModeration                     : True
AllowPacketDirect                       : False
IsLegacy                                : False
IsSynthetic                             : True
IPAddresses                             : {}
DeviceNaming                            : Off
IovWeight                               : 0
IovQueuePairsRequested                  : 1
IovInterruptModeration                  : Default
PacketDirectNumProcs                    : 0
PacketDirectModerationCount             : 64
PacketDirectModerationInterval          : 1000000
IovQueuePairsAssigned                   : 0
IovUsage                                : 0
VirtualFunction                         :
MandatoryFeatureId                      : {}
MandatoryFeatureName                    : {}
PoolName                                :
Connected                               : True
SwitchName                              : ToInternal
AdapterId                               : 5B6CF86F-8B51-426F-840F-5F1B9DD5460F
TestReplicaPoolName                     :
TestReplicaSwitchName                   :
StatusDescription                       : {Degraded, The protocol version of the component installed in the virtual machine does not match the version
                                          expected by the hosting system}
Status                                  : {Degraded, ProtocolVersion}
IsManagementOs                          : False
IsExternalAdapter                       : False
Id                                      : Microsoft:6ABB8E25-2BB1-4A7E-B19B-8D4DFC68A64B\5B6CF86F-8B51-426F-840F-5F1B9DD5460F
SwitchId                                : f9884cc2-8d28-4c68-8f3b-202b55d77b90
AclList                                 : {}
ExtendedAclList                         : {}
IsolationSetting                        : VMNetworkAdapterIsolationSetting
RoutingDomainList                       : {}
VlanSetting                             : VMNetworkAdapterVlanSetting
BandwidthSetting                        :
CurrentIsolationMode                    : Vlan
MacAddressSpoofing                      : Off
DhcpGuard                               : Off
RouterGuard                             : Off
PortMirroringMode                       : None
IeeePriorityTag                         : Off
VirtualSubnetId                         : 0
DynamicIPAddressLimit                   : 0
StormLimit                              : 0
AllowTeaming                            : Off
FixSpeed10G                             : Off
VMQWeight                               : 100
IPsecOffloadMaxSA                       : 512
VrssEnabled                             : False
VrssEnabledRequested                    : True
VmmqEnabled                             : False
VmmqEnabledRequested                    : False
VrssMaxQueuePairs                       : 1
VrssMaxQueuePairsRequested              : 16
VrssMinQueuePairs                       : 1
VrssMinQueuePairsRequested              : 1
VrssQueueSchedulingMode                 : Dynamic
VrssQueueSchedulingModeRequested        : Dynamic
VrssExcludePrimaryProcessor             : False
VrssExcludePrimaryProcessorRequested    : False
VrssIndependentHostSpreading            : False
VrssIndependentHostSpreadingRequested   : False
VrssVmbusChannelAffinityPolicy          : Strong
VrssVmbusChannelAffinityPolicyRequested : Strong
VmqUsage                                : 0
IPsecOffloadSAUsage                     : 0
VFDataPathActive                        : False
VMQueue                                 :
BandwidthPercentage                     : 0
IsTemplate                              : False
Name                                    : Network Adapter
VMId                                    : 6abb8e25-2bb1-4a7e-b19b-8d4dfc68a64b
VMName                                  : DockerHostA
VMSnapshotId                            : 00000000-0000-0000-0000-000000000000
VMSnapshotName                          :
CimSession                              : CimSession: .
ComputerName                            : WIN10LATESTA
IsDeleted                               : False

In this situation, I either need to kill the docker-machine process or wait for it to timeout.

Please note that this problem (i.e. boot2docker not recognizing the Network Adapter as a device) happens about 70% of the time. However, about 30% of the time, it actually works as expected.

If I am lucky enough to actually establish a Docker Machine, after a baremetal host reboot (or really, in any situation where the Docker Machine VM is going from a non "Running" state to a "Running" state), there is a similar probability that the same thing will happen (i.e. boot2docker not recognizing the Network Adapter as a device).

After several Docker Machine VM reboots, it eventually works as expected. However, this is very inconsistent - sometimes it takes 1 VM reboot, sometimes it takes 10. Doesn't matter if you use docker-machine restart DockerHostA or Restart-VM -Name DockerHostA.

This was also tested with similar results with the latest v18.03.0-ce-rc4 boot2docker.iso.

@tianon
Copy link
Contributor

tianon commented Mar 21, 2018

Does it work in Debian? We don't have the necessary setup to reproduce or expertise to debug this, so this is definitely going to have to be a community contribution if we're going to figure out a way to fix it.

Additionally, if you're using Hyper-V, why not use Docker for Windows instead of boot2docker / docker-machine? The primary reason boot2docker and docker-machine still exist (from my own understanding, which may not even have all the facts) is for users that can't use Hyper-V because they're on an older version of Windows, don't have Pro, or have to use VMware or VirtualBox for other aspects of their job/work (and thus cannot use Hyper-V and Docker for Windows).

@pldmgg
Copy link
Author

pldmgg commented Mar 22, 2018

I mostly ended up looking at docker-machine with Docker For Windows because I had to factory reset Docker For Windows one-too-many-times during testing, which blew away my containers, so I figured it would be better to have dedicated VMs that survive a Docker For Windows factory reset.

Setting up boot2docker using a Debian/Ubuntu or CentOS/RedHat VM works fine and is really easy when I do the following in a PowerShell Session...

docker-machine create --driver generic --generic-ip-address $VMIPv4Address --generic-ssh-user docker --generic-ssh-key "$("$HOME\.ssh\private_key.pem" -replace "\\","/")" $VMName

...it's just that these VMs take up a lot more disk space - which is kind of becoming more of an issue with more modern hard drives that perform a lot better but generally don't have a lot of total space.

@tianon
Copy link
Contributor

tianon commented Apr 25, 2019

Is this still an issue on the latest releases?

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

No branches or pull requests

3 participants