IotEdge eFlow: copyEflowVMFile raises errors in Vsock

86 views Asked by At

running eFlow on Windows Server 2022

Every 10 sec a copyEflowVMFile is running. Result is ok, till: This raises failed VSock units inside VM. After 1 day more then 50k entries like: "sshd_vsock@983-4294967295:22-2:2653259677.service
loaded failed failed SSH Per-Connection Server (vsock:2:2653259677) "

Systemd.log shows entries like: "Failed to start session scope session-121701.scope: Unit sysroot-var.mount not found." ... "Standard output type syslog is obsolete, automatically updating to journal. Please update your unit file, and consider removing the setting altogether. " ...

At the end: "Stopping User Manager for UID 13623." (iotedge-user)

Any hint, why the copy command raises this error inside VM? Where is sysroot-var.mount defined?

2

There are 2 answers

2
Sampath On

Using PowerShell functions for Azure IoT Edge for Linux on Windows with Copy-EflowVmFile

Prerequisites:

  1. AzureEFLOW.psm1 File:

    • The commands described in the article are part of the AzureEFLOW.psm1 file.
    • This file can be found on your system in your WindowsPowerShell directory under C:\Program Files\WindowsPowerShell\Modules\AzureEFLOW.
  2. Azure IoT Edge for Linux on Windows Installation:

    • If you don't have the AzureEflow folder in your PowerShell directory, you need to download and install Azure IoT Edge for Linux on Windows using the following steps:
      • Run the appropriate command based on your architecture (X64/AMD64 or ARM64) in an elevated PowerShell session to download IoT Edge for Linux on Windows.
      • Install IoT Edge for Linux on Windows on your device using the Start-Process command.
  3. Set Execution Policy:

    • Set the execution policy on the target device to at least AllSigned using the Set-ExecutionPolicy PowerShell command. Copy-EflowVmFile is a command or function, possibly specific to a certain environment or tool. This command is designed to copy files to or from a virtual machine using SCP (Secure Copy Protocol).

Copy-EflowVmFile:

Copy-EflowVmFile -fromFile "local/path/to/source/file.txt" -toFile "remote/path/on/vm/file.txt" -pushFile
  • -fromFile: Specifies the local file path you want to copy from.
  • -toFile: Specifies the remote file path on the virtual machine where you want to copy the file.
  • -pushFile: This flag indicates the direction of the copy. If present, it means you are pushing the file to the virtual machine. If absent, it means you are pulling the file from the virtual machine.
  • You can get detailed information about the command using the Get-Help command:
Get-Help Copy-EflowVMFile -Full

enter image description here

  • The Connect-EflowVm command connects to the virtual machine using SSH.
Connect-EflowVm

Make sure you create the folder in EFlow before running the Copy-EflowVmFile command.

mkdir Folder

enter image description here

1
Gerald Kluge On

like commited by MS Product team ist the high number of failed units the cause for stucking the Copy. Reason for this is currently in search. Wporkaraound is regularly "systemctl reset-failed sshd_vsock*"