Giter Club home page Giter Club logo

kvm-template's Introduction

kvm-template

order by www.361way.com

这里一共有三个版本的脚本,作用是一致的都是利用模板来快速的创建kvm guest主机

shell/create_kvm.sh为shell脚本版本 ,来自51cto上rolandqu写的一个版本
v1.0为python重写的1.0版本 ,来自51cto坏男孩的版本
v2.0为python重写的2.0版本 ,这个是我写的一个版本,主要参照坏男孩的版本,做了功能增强和xml块的优化

利用python脚本通过模板img和xml文件实现KVM的快速部署

v2.0用法为: 编辑conf里的配置文件,具体可以查看template2.py里的指向的配置文件 ,如果增加虚拟机使用add,删除使用delete参数

V2.0版里一定要指定6个参数,在删除guest主机时,后面两个参数可以随意写,不做验证

#Action,Vm_name,Template_img_file,Template_xml_file,VM_mem,VM_vcpu
add,mc,template.qcow2,template_qcow2.xml,1024,1
delete,nagios,template.qcow2,template_qcow2.xml,0,0

编辑完conf里的ini文件后,执行python template2.py即可!

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.