Uploaded image for project: 'Migration Toolkit for Virtualization'
  1. Migration Toolkit for Virtualization
  2. MTV-3590

SSH method: Support multiple datastores with inline command routing

XMLWordPrintable

    • Icon: Story Story
    • Resolution: Unresolved
    • Icon: Undefined Undefined
    • None
    • None
    • None
    • False
    • Hide

      None

      Show
      None
    • False
    • Not Selected

      Problem

      Current SSH method hardcodes datastore path in authorized_keys, causing failures when migrating VMs from different datastores.

      command="python /vmfs/volumes/TEST_DS/secure-vmkfstools-wrapper.py",...
      

      Solution

      Use inline shell command to dynamically route based on datastore in SSH command:

      command="sh -c 'DS=$(echo \"$SSH_ORIGINAL_COMMAND\" | sed -n \"s|._/vmfs/volumes/\\([^/]_\\)/.*|\\1|p\"); exec python /vmfs/volumes/$DS/secure-vmkfstools-wrapper.py'",no-port-forwarding,no-agent-forwarding,no-X11-forwarding ssh-rsa [key]
      

      Benefits

      • Single SSH key works for all datastores
      • No wrapper script needed
      • Simpler user setup

      Tasks

      • Update EnableSSHAccess() to generate inline command format
      • Update documentation
      • Test with multiple datastores on ESXi 7.x/8.x

              bodnopoz@redhat.com Boris Odnopozov
              bodnopoz@redhat.com Boris Odnopozov
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: