acs-engine icon indicating copy to clipboard operation
acs-engine copied to clipboard

Azure File shares cannot be accessed from a container running on a Windows agent

Open chweidling opened this issue 9 years ago • 11 comments

Is this a request for help? No


Is this an ISSUE or FEATURE REQUEST? ISSUE


What version of acs-engine? 0.9.1


Orchestrator and version (e.g. Kubernetes, DC/OS, Swarm) kubernetes 1.8.2

What happened: When accessing an Azure Files share from a container running on a Windows agent, I get the following error:

System error 1783 has occurred.

The stub received bad data.

This is independent from the template. I tried it with and without custom VNET, with a single Windows agent and with multiple Windows agents. I tried with older versions of acs-engine (0.8, 0.7) and with other kubernetes versions (1.7.x) - the behaviour is always the same. The problem suddenly appeared at the beginning of October. In September this problem was not there.

How to reproduce it (as minimally and precisely as possible):

  • Create an Azure Storage account xyz and add a file share myshare to this account.
  • Deploy a kubernetes cluster with acs-engine, which contains at least one Windows agent.
  • Run kubectl run -it servercore --image microsoft/windowsservercore
  • Try to mount the share in the container: net use Z: \\xyz.file.core.windows.net\myshare /u:AZURE\xyz <your_key>. You receive the following error:
System error 1783 has occurred.

The stub received bad data.

But if you create a new Azure VM (Windows Server 2016 with Containers), and run a container like this: docker run -it --name servercore microsoft/windowsservercore then the mount operation succeeds.

chweidling avatar Nov 08 '17 16:11 chweidling

@JiangtianLi This will take some investigation. When you have some spare cycles, could you kindly look into this?

jackfrancis avatar Nov 13 '17 19:11 jackfrancis

@chweidling Can you let me know what is your kubelet version and windows os version, e.g., the output of the following?

kubectl get no -o wide

@andyzhangx Can you take a look since this is related to Azure File?

JiangtianLi avatar Nov 13 '17 21:11 JiangtianLi

@JiangtianLi kubectl get no -o wide returns

NAME                    STATUS    ROLES     AGE       VERSION                    EXTERNAL-IP   OS-IMAGE                      KERNEL-VERSION                                           CONTAINER-RUNTIME
11123k8s9000            Ready     <none>    22m       v1.8.2-18+3d35a4c5aec26c   <none>        <unknown>                     10.0 16299 (16299.15.amd64fre.rs3_release.170928-1534)   docker://Unknown
k8s-master-11123980-0   Ready     master    22m       v1.8.2                     <none>        Debian GNU/Linux 8 (jessie)   4.11.0-1014-azure                                        docker://1.12.6

On the Windows agent, the output of ver is Microsoft Windows [Version 10.0.16299.19]

I used acs-engine 0.9.3.

chweidling avatar Nov 14 '17 10:11 chweidling

I have tried a k8s cluster based on current rs3 image, it works well. I could be due to the network code change, as I could see, there is Ethernet adapter vEthernet change, l2bridge works, while Container NIC not works. @JiangtianLi, do you have more knowledge about this?

Following works:

C:\>ipconfig
Windows IP Configuration
Ethernet adapter vEthernet (4a54c3a966850a5d23b75a161b3c7b54acb8ca293e215c0d0f9eca3dfbc70f33_l2bridge):
   Connection-specific DNS Suffix  . :
   Link-local IPv6 Address . . . . . : fe80::84e2:875e:3085:2f18%24
   IPv4 Address. . . . . . . . . . . : 10.244.1.220
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . : 10.240.0.1

Following not works:

C:\>ipconfig
Windows IP Configuration
Ethernet adapter vEthernet (Container NIC bf991604):
   Connection-specific DNS Suffix  . :
   Link-local IPv6 Address . . . . . : fe80::d055:fe87:c380:27fe%33
   IPv4 Address. . . . . . . . . . . : 10.244.1.8
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . : 10.244.1.1

andyzhangx avatar Nov 14 '17 13:11 andyzhangx

@andyzhangx How was the working cluster (with Azure File) deployed? Does networking work (POD to POD, outbound)? The first non-working cluster has the correct networking config though. @chweidling Your cluster is RS3. Did you create the container with 1709 tag?

JiangtianLi avatar Nov 14 '17 19:11 JiangtianLi

@JiangtianLi My deployment is created with this file:

{
  "apiVersion": "vlabs",
  "properties": {
    "orchestratorProfile": {
      "orchestratorType": "Kubernetes",
      "orchestratorRelease": "1.8"
    },
    "masterProfile": {
      "count": 1,
      "dnsPrefix": "chw-jf",
      "vmSize": "Standard_D2s_v3"
    },
    "agentPoolProfiles": [
      {
        "name": "backend",
        "availabilityProfile": "AvailabilitySet",
        "count": 3,
        "osType": "Windows",
        "vmSize": "Standard_D4s_v3"
      }
    ],
    "windowsProfile": {
      "adminUsername": "XXX",
      "adminPassword": "XXX"
    },
    "linuxProfile": {
      "adminUsername": "XXX",
      "ssh": {
        "publicKeys": [
          {
            "keyData": "ssh-rsa XXXX"
          }
        ]
      }
    },
    "servicePrincipalProfile": {
      "clientId": "XXX",
      "secret": "XXX"
    }
  }
}

The container/pod was crreated with kubectl run -it core --image microsoft/windowsservercore

Currently I cannot deploy any Windows container on a cluster created with acs-engine 0.9.3. (When running the container, there is an error The operating system of the container does not match the operating system of the host.)

Further remarks: When I deploy with acs-engine 0.8.0, I have the following output of kubectl get nodes -o wide:

NAME                    STATUS    ROLES     AGE       VERSION                   EXTERNAL-IP   OS-IMAGE                      KERNEL-VERSION                                                      CONTAINER-RUNTIME
11123acs9000            Ready     <none>    2m        v1.8.0-8+cbbb894c1a1b70   <none>        <unknown>                     10.0 14393 (14393.1715.amd64fre.rs1_release_inmarket.170906-1810)   docker://Unknown
k8s-master-11123980-0   Ready     master    2m        v1.8.0                    <none>        Debian GNU/Linux 8 (jessie)   4.4.0-98-generic                                                    docker://1.12.6

chweidling avatar Nov 14 '17 22:11 chweidling

@chweidling acs-engine 0.8.0 deploys RS1 Windows in the cluster and Windows POD uses microsoft/windowsservercore image. acs-engine 0.9.3 deploys RS3 Windows in the cluster and Windows POD uses microsoft/windowsservercore:1709 image. To clarify, is the Azure File issue on cluster deployed by acs-engine 0.9.3?

JiangtianLi avatar Nov 14 '17 23:11 JiangtianLi

@JiangtianLi The Azure File issue is on an 0.8.0 deployment. But, 0.8.0 deployments were working until middle of October. Then suddenly the issue was there. The same issue I have when I use Azure Container Service to deploy a kubernetes cluster.

Also with acs 0.9.1 I had this problem. At the moment I cannot deploy a Windows container with 0.9.3 in order to test it because of the The operating system of the container does not match the operating system of the host. problem.

chweidling avatar Nov 15 '17 06:11 chweidling

@chweidling Try with following example to deploy a windows pod: https://github.com/andyzhangx/Demo/blob/master/windows/azurefile/rs3/windowsservercore-pod-azurefile.yaml

You could find detailed steps here: https://github.com/andyzhangx/Demo/blob/master/windows/azurefile/rs3/windowsservercore-pod-azurefile.yaml

This version should work for mounting azure file

andyzhangx avatar Nov 16 '17 08:11 andyzhangx

@andyzhangx: Thank you for the hint. With a 1709 image I could mount the file share inside my container.

This issue is resolved.

chweidling avatar Nov 16 '17 16:11 chweidling

Thanks @andyzhangx !

jackfrancis avatar Nov 16 '17 18:11 jackfrancis