Git Product home page Git Product logo

ansible-kvm's Introduction

Virtual machine creation

This playbook uses Ansible to create virtual machines on host server. Create your own XML file for the VM and then run this playbook to create as many VMs as you like.

Requirements

  • The following packages should be installed on the host server
apt install ansible libguestfs-tool python3-libvirt
  • Install the latest version of Ansible community general
ansible-galaxy collection install community.general
  • You should create your own XML file for the VM to use as template.

Steps to create virtual machine

  1. Enter the VM hostnames in the vm_name.txt file. For example:
srv16-mme-1
srv16-mme-2
.
.
.
  1. Edit the kvm_provision.yaml file and specify the resources for the server.
  2. Place the .qcow2 base image in the /var/lib/libvirt/images and rename it to sample-mme-image.qcow2
  3. Place the sample coredump .qcow2 image in the /data directory and rename it to sample-coredump.qcow2
  4. Edit the VM template file under roles/kvm_provision/templates/vm-template.xml.j2 to match your desired state.
  5. Execute the create_vm script to start creating VMs.

Network configuration

  1. Edit the configure_network.sh file and specify the gateways for all intefaces. (OM,s1mme,s11,db)
  2. Edit the mme_name.txt file in this directory and specify the information in this format:
MME_NAME OM_IP S1MME_IP S11_IP DB_IP

An example would be like this:

srv16-mme-1 172.17.93.80/22 172.17.80.194/27 172.17.56.34/27 172.17.88.194/27
  1. Make sure that all hostnames (e,g srv16-mme-1) resolve to the IP of the host machine libvirt interface. You can edit the /etc/hosts as so:
srv16-mme-1     192.168.10.1
  1. Execute the configure_network.sh script to start the configuration proccess.

ansible-kvm's People

Stargazers

Paulo Paz avatar

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.