Giter VIP home page Giter VIP logo

vmware-automation's Introduction

VMware Automation

This are a set of scripts to simplify the deployment of virtual machines in the VMWare vSphere infrastructure from python script.

INSTALLATION

pip3 install pyVim pyVmomi requests argcomplete paramiko python_terraform requests 

For autocomplete in bash

pip install argcomplete
activate-global-python-argcomplete

echo 'eval "$(register-python-argcomplete YouScriptDir(ex. ./run.sh) )"' >> ~/.bashrc
sourse ~/.bashrc

PHPipam

For this stack need PhpIPAM system: https://github.com/phpipam/phpipam

Add $api_allow_unsafe = true; in config.php in your phpipam system

Example for create Only new IP in PHPIpam system run:

./run.py \
--vmname=test-vm01 \
--desc="Test IP"
--net=192.168.222.0/24 \
--onlyip

Credentials

Before use create credential file

cat >passwd.py<<EOF!
user_api = '__you_user_name__' # IPAM user
pass_api = '__pwd__' # IPAM user password
vc_user  = '__you_user_name__' # vCenter administrator user name
vc_pass  = '__pwd__' # vCenter administrator user password
sd_user = '__you_user_name__' # ServiceDesk User
sd_pass = '__pwd__' # ServiceDesk password

EOF!

PARAMETERS file

cat >parameters.py<<EOF!
vc_list = [
    'vcsa01.srv.local',
    'vcsa02.srv.local',
    ....
]

template_linux = [
    'template_centos',
    'template_ubuntu'
    ......
]

template_wind = [
    'template_win2008',
    'template_win2012R2',
    ......
]

template_list = template_linux + template_wind
EOF!

HELP

For Help USAGE:

./run.py --help

vmware-automation's People

Contributors

akrush24 avatar nikolonso avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

vmware-automation's Issues

Выделение IP на основе CIDR а не Subnet ID

Пример реализации

$ curl -H 'token:6Bbjz4WsQ68DsM5U!506MO--' http://ipam.phoenixit.ru/api/apiclient/subnets/cidr/192.168.24.0/24

{"code":200,"success":true,"data":[{"id":"22","subnet":"192.168.24.0","mask":"24","sectionId":"3","description":null,"linked_subnet":null,"firewallAddressObject":null,"vrfId":"0","masterSubnetId":"16","allowRequests":"0","vlanId":"70","showName":"0","device":"0","permissions":"[]","pingSubnet":"1","discoverSubnet":"1","DNSrecursive":"0","DNSrecords":"0","nameserverId":"0","scanAgent":"1","isFolder":"0","isFull":"0","tag":"2","threshold":"0","location":"0","editDate":"2018-08-24 13:45:01","lastScan":"2018-08-24 13:45:01","lastDiscovery":"2018-08-24 13:45:01","resolveDNS":"0"},{"id":"130","subnet":"192.168.24.0","mask":"24","sectionId":"21","description":null,"linked_subnet":null,"firewallAddressObject":null,"vrfId":"0","masterSubnetId":"141","allowRequests":null,"vlanId":"0","showName":"0","device":"0","permissions":"[]","pingSubnet":"1","discoverSubnet":"1","DNSrecursive":"0","DNSrecords":"0","nameserverId":"0","scanAgent":"2","isFolder":"0","isFull":"0","tag":"2","threshold":"0","location":"12","editDate":"2018-08-15 11:31:58","lastScan":null,"lastDiscovery":null,"resolveDNS":"0"}],"time":0.01}[

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.