Coder Social home page Coder Social logo

[Feature]: vSphere Support about suzieq HOT 15 OPEN

netgun avatar netgun commented on June 3, 2024
[Feature]: vSphere Support

from suzieq.

Comments (15)

ddutt avatar ddutt commented on June 3, 2024 1

@tgupta3 i highly recommend you join the SuzieQ slack. Interactions can be much faster plus others will pitch in.

from suzieq.

ddutt avatar ddutt commented on June 3, 2024

Thank you for the suggestion @netgun . This is very useful, no doubt. But this will be a massive effort, as I see it. We have to acquaint ourselves with VMWare API, which we have no way to test, as we can't purchase VMW products :).

What help can you provide us?

from suzieq.

tgupta3 avatar tgupta3 commented on June 3, 2024

I'm happy to take this as we already have a lot of VMware deployments with & without NSX that I can use to test the code. In return, it would also be beneficial for us to observe the lifecycle of a VM.

Are we just looking to discover what vms are connected to which dvs and which portgroup ?

from suzieq.

ddutt avatar ddutt commented on June 3, 2024

What do you mean by "'m happy to take this on", @tgupta3 ?

from suzieq.

tgupta3 avatar tgupta3 commented on June 3, 2024

@ddutt I meant I can implement this.

from suzieq.

netgun avatar netgun commented on June 3, 2024

I am happy to help with anything that I can. I am not a developer but can help with things like docs and can even try to get technical questions answered by the developers.

Docs are here https://developer.vmware.com/apis

from suzieq.

ddutt avatar ddutt commented on June 3, 2024

Fantastic @tgupta3 , happy to help you with this. @netgun if you can help test, that'd be great.

First thing we need to do is define what is the information we want to save.

from suzieq.

tgupta3 avatar tgupta3 commented on June 3, 2024

IMO from troubleshooting point of view two things are very useful

  1. If a VM existed at a point in time and if it was which segment and DVS it was on and also the vcenter it was on ?
  2. The discovered IP for that VM, and maybe other metadata like creation date and template.

from suzieq.

ddutt avatar ddutt commented on June 3, 2024

@tgupta3 So, what API calls are necessary for each? Whats the output of each of those API calls? We can start there

from suzieq.

tgupta3 avatar tgupta3 commented on June 3, 2024

I think this is a good example. It would look very similiar except use content.viewManager.CreateContainerView on vim.DistributedVirtualSwitch.

Once you have all the DVS, it's just a couple of for loops to iterate over the portgroups and then vms to get individual vm.
The metadata from the vm can be extracted using the objects defined here . I think the discovered ip address is available in vim.vm.Summary.GuestSummary) but I will have to double check.

from suzieq.

ddutt avatar ddutt commented on June 3, 2024

Can you put together a list of fields you'll capture, @tgupta3 ?

from suzieq.

tgupta3 avatar tgupta3 commented on June 3, 2024

I think 2 tables would be a good starting point

  1. VMs
  • VM ID: Unique identifier for the VM (this is mostly useful for log analysis)
  • VM Name: Name of the VM.
  • VM State: Current state of the VM denoted as ENUM
  • Host ID: Identifier of the host machine on which the VM is running.
  • Operating System: OS installed
  • CPU Allocation: CPU specs
  • Memory Allocation: Memory specs
  • Creation Date: Date and time when the VM was created.
  1. VM interfaces
  • Interface ID: Identifer of the interface
  • VM ID: Identifier of the VM
  • MAC Address: MAC address
  • IP Address(es): IP address(es) associated with the network interface.
  • Connected Port ID: Identifier of the port on the virtual switch to which this interface is connected.
  • DVS: Name or ID of the DVS
  • Status: Operational status

I think with this information, we would be able to construct what the state of the environment looked like. Do you think we would be able to extend it to talk to the network device information to trace the path end to end rather than just terminating on the port of the TOR ?

from suzieq.

tgupta3 avatar tgupta3 commented on June 3, 2024

@ddutt Can you help me out a bit with how to structure. I was able to write the base layer code to connect and fetch data from vcenter, but i'm having issues on how to fetch data for each vm. I noticed in the `suzieq/config/*.yaml, usually the commands given fetches all data. However in the case of vcenter, it's a two step process

  1. Get all Vms list
  2. Get details about those vms or do a for each.

The API is documented here

Is there an example I can refer to that would help me with this ?

from suzieq.

ddutt avatar ddutt commented on June 3, 2024

@tgupta3 IMO, vCenter needs to be treated as an inventory source which is polled for a list of VMs and their IPs, and then you poll each VM like you would a server. Does this make sense? Look at the netbox code (suzieq/poller/controller/source/netbox.py) for modelling vCenter as an inventory source. each VM will then show up as a device under device table, with interfaces, addresses and such. Does this make sense?

from suzieq.

tgupta3 avatar tgupta3 commented on June 3, 2024

Great, that's a good idea. Let me go through that, will reach out if I run into issues.

from suzieq.

Related Issues (20)

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.