Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integration with forklift / MTV tool for virtual machine migrations as Hooks #2

Open
jsakil14 opened this issue Jul 17, 2024 · 3 comments

Comments

@jsakil14
Copy link

jsakil14 commented Jul 17, 2024

Hello , I came across your repo which is supporting my requirement of capturing the n/w & disk config of windows vms before migration & applying the same post migration - in my case from vmware to openshift / kubevirt clusters and running it as a hook in terms of forklift operator. Would you be able to help me to integrate this scripts into the below page:

https://github.com/kubev2v/forklift/blob/main/docs/hooks.md

https://www.imghippo.com/i/gkEz61721194794.png

@jsakil14
Copy link
Author

[WARNING]: No inventory was parsed, only implicit localhost is available
[WARNING]: provided hosts list is empty, only localhost is available. Note that
the implicit localhost does not match 'all'
[WARNING]: Collection ansible.windows does not support Ansible version
2.12.5.post0
PLAY [Pre-migration tasks] *****************************************************
TASK [Gathering Facts] *********************************************************
ok: [localhost]
TASK [Copy PowerShell script file] *********************************************
fatal: [localhost]: FAILED! => {"changed": false, "checksum": "36df118a11c01420ac0edf2c7954f0e4162cc307", "dest": "C:\\Windows\\Temp\\", "module_stderr": "/bin/sh: powershell: command not found\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "operation": "file_copy", "original_basename": "pre-migrate.ps1", "rc": 127, "size": 13232, "src": "files/pre-migrate.ps1"}
PLAY RECAP *********************************************************************
localhost : ok=1 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0

@jsakil14
Copy link
Author

jsakil14 commented Jul 17, 2024

@fabiendupont

---
- name: Pre-migration tasks
  hosts: localhost
  gather_facts: no

  tasks:
    - name: Copy PowerShell script file
      ansible.windows.win_copy:
        src: "files/pre-migrate.ps1"
        dest: 'C:\\Windows\\Temp\\'

    - name: Run PowerShell command
      ansible.windows.win_command:
        cmdline: 'C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe -ExecutionPolicy Bypass -File C:\\Windows\\Temp\\pre-migrate.ps1'

@jsakil14
Copy link
Author

Is it possible to create a Dockerfile with which I can build an image out of this script which I can inturn run as a prehook in MTV by openshift for windows vms?

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

No branches or pull requests

1 participant