GithubHelp home page GithubHelp logo

pyvmomicommissionsamples's Introduction

pyvmomiCommissionSamples

根据pyvmomi-community-samples项目衍生出来的,根据自己的业务操作进行了相应调整

在使用过程中遇到的一些坑

  1. SSL or NoSSL
    一些脚本中会根据输入的参数-S来使用不同的连接方式(SmartConnect or SmartConnectNoSSL),但有些脚本中则统一采用SmartConnect,这样就会造成连接vcenter的时候报(ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed),这个时候请修改脚本,提交-S的参数判断或者默认就采用SmartConnectNoSSL的连接方式
  2. decode() 在deploy_ova.py脚本中,我们需要通过IO获取ova文件并将其部署到vmware vcenter上,默认decode的编码是Unicode,但由于环境的原因会造成相应的编码错误(UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 2161), 我们需要在decode的时候标注我们需要utf-8编码
  3. AttributeError: 'NoneType'

在使用过程中理解的内容

  1. si = connect.SmartConnectNoSSL()
  2. atexit.register(connect.Disconnect, si)
  3. container = si.content.viewManager.CreateContainerView(si.content.rootFolder, [vim.VirtualMachine], True)
  4. root = si.content.rootFolder
  5. entity_stack = root.childEntity
  6. content = si.RetrieveContent()
  7. views = container.view
  8. summary = view.summary

pyvmomicommissionsamples's People

Contributors

zackgq2009 avatar

Stargazers

 avatar Nelson Fonseca avatar

Watchers

James Cloos avatar  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.