Giter VIP home page Giter VIP logo

new-unixvm's Introduction

New-UnixVM

Powershell function to create new Unix VM from a template in Hyper-V. This function copies the VHD of an existing template VM and provisions the new VM using cloud-init.

Pre-requisities

  1. Create a template Linux VM with cloud-init installed. By default this function tries to find template VM named "Template-CentOS8" but you can change that in parameters.
  2. Make sure you have OSCDIMG installed on your hypervisor. ADK can be downloaded from here. You only need to install deployment tool.
  3. Add your SSH key to Line 255. Or if you are comfortable feel free to edit cloud-init config as per your needs.

Limitations

  1. Cloud-init config is very basic. It is used to do the bare minimum to power up the VM, the idea is that once the VM is online Ansible will take over to complete rest of the tasks
  2. The disk parition inside new Linux VM is not expanded so the size will be same as template VM and you will need to manully expand the partition and file syste. Similarly, secondary VHD is not initialized at all just attached to the VM. I am currently working on Ansible playbook to handle these tasks, which are in very early stages. (I just started to learn Ansible)
  3. This was only tested with CentOS8 Server. Since cloud-init same across other distros I am pretty sure it will just work.
  4. On the hypervisor side it was only tested with Windows Server 2016 And Windows Server 2019, but it should work fine with Windows Server 2012 as long as it has Powershell 5 installed.

Next Steps

  1. I will see how well this function servers in its current form and will be making adjustments improvements as needed
  2. Once the function is matured I'll add it to powershell gallery.

Improvements/Feedback

I'm always happy to hear any feedback so if you have any ideas for improvement or face any issues feel free to open an issue. Contributions are welcome.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.