simulator

package
v0.0.0-...-5f55900 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 11, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

README

ESX Agent Manager (EAM) Simulator

This simulator package works with the existing vC Sim. Please see simulator_test.go for an example of how to use the EAM simulator with vC Sim.

Use Docker to Simulate Agent VMs

It is possible to run the simulator test whereby the creation of agent VMs results in the creation of containers in Docker to simulate the lifecycle of the VMs. Docker must be installed and running, but other than that, simply set the value of the AgentConfigInfo.OvfPackageUrl field to a:

  • non-empty string,
  • that does not start with ./, /, or https?:.

If those conditions are met, then the EAM simulator treats this value as the name of a Docker image, and will create a simualted VM with RUN.container key set to the value, causing the core vC Simulator to simulate the VM with a container based on the specified image.

Example of Simulated Agent VMs

There is a test that provides an example of this simulated agent VM behavior. Again, Docker must be installed and running, but otherwise just execute the following:

go test -v ./simulator/ -powerOnVMs

The flag -powerOnVMs causes the the simulator test code to create the agencies with agent configuration information that uses the nginx container to simulate two VMs. The presence of the flag then causes the VMs to be powered on, and the test waits for the agent runtime information to report the VMs' power state and IP addresses.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New() *simulator.Registry

Types

type Agency

type Agency struct {
	EamObject
	mo.Agency
}

Agency handles the deployment of a single type of agent virtual machine and any associated VIB bundle, on a set of compute resources.

func NewAgency

func NewAgency(
	ctx *simulator.Context,
	baseAgencyConfig types.BaseAgencyConfigInfo,
	initialGoalState string) (*Agency, vim.BaseMethodFault)

NewAgency returns a new Agency as if CreateAgency were called on the EsxAgentManager object.

func (*Agency) AgencyQueryRuntime

func (m *Agency) AgencyQueryRuntime(
	ctx *simulator.Context,
	req *types.AgencyQueryRuntime) soap.HasFault

func (*Agency) Agency_Disable

func (m *Agency) Agency_Disable(
	ctx *simulator.Context,
	req *types.Agency_Disable) soap.HasFault

func (*Agency) Agency_Enable

func (m *Agency) Agency_Enable(
	ctx *simulator.Context,
	req *types.Agency_Enable) soap.HasFault

func (*Agency) DestroyAgency

func (m *Agency) DestroyAgency(
	ctx *simulator.Context,
	req *types.DestroyAgency) soap.HasFault

func (*Agency) QueryAgent

func (m *Agency) QueryAgent(
	ctx *simulator.Context,
	req *types.QueryAgent) soap.HasFault

func (*Agency) QueryConfig

func (m *Agency) QueryConfig(
	ctx *simulator.Context,
	req *types.QueryConfig) soap.HasFault

func (*Agency) RegisterAgentVm

func (m *Agency) RegisterAgentVm(
	ctx *simulator.Context,
	req *types.RegisterAgentVm) soap.HasFault

func (*Agency) Uninstall

func (m *Agency) Uninstall(
	ctx *simulator.Context,
	req *types.Uninstall) soap.HasFault

func (*Agency) UnregisterAgentVm

func (m *Agency) UnregisterAgentVm(
	ctx *simulator.Context,
	req *types.UnregisterAgentVm) soap.HasFault

func (*Agency) Update

func (m *Agency) Update(
	ctx *simulator.Context,
	req *types.Update) soap.HasFault

type Agent

type Agent struct {
	EamObject
	mo.Agent
}

Agenct is the vSphere ESX Agent Manager managed object responsible fordeploying an Agency on a single host. The Agent maintains the state of the current deployment in its runtime information

func NewAgent

NewAgent returns a new Agent as if CreateAgency were called on the EsxAgentManager object.

func (*Agent) AgentQueryConfig

func (m *Agent) AgentQueryConfig(
	ctx *simulator.Context,
	req *types.AgentQueryConfig) soap.HasFault

func (*Agent) AgentQueryRuntime

func (m *Agent) AgentQueryRuntime(
	ctx *simulator.Context,
	req *types.AgentQueryRuntime) soap.HasFault

func (*Agent) MarkAsAvailable

func (m *Agent) MarkAsAvailable(
	ctx *simulator.Context,
	req *types.MarkAsAvailable) soap.HasFault

type AgentVMPlacementOptions

type AgentVMPlacementOptions struct {
	// contains filtered or unexported fields
}

type EamObject

type EamObject mo.EamObject

EamObject contains the fields and functions common to all objects.

func (*EamObject) AddIssue

func (m *EamObject) AddIssue(
	ctx *simulator.Context,
	req *types.AddIssue) soap.HasFault

func (*EamObject) QueryIssue

func (m *EamObject) QueryIssue(
	ctx *simulator.Context,
	req *types.QueryIssue) soap.HasFault

func (*EamObject) Reference

func (m *EamObject) Reference() vim.ManagedObjectReference

func (*EamObject) Resolve

func (m *EamObject) Resolve(
	ctx *simulator.Context,
	req *types.Resolve) soap.HasFault

func (*EamObject) ResolveAll

func (m *EamObject) ResolveAll(
	ctx *simulator.Context,
	req *types.ResolveAll) soap.HasFault

type EsxAgentManager

type EsxAgentManager struct {
	EamObject
}

EsxAgentManager is the main entry point for a solution to create agencies in the vSphere ESX Agent Manager server.

func (*EsxAgentManager) CreateAgency

func (m *EsxAgentManager) CreateAgency(
	ctx *simulator.Context,
	req *types.CreateAgency) soap.HasFault

func (*EsxAgentManager) QueryAgency

func (m *EsxAgentManager) QueryAgency(
	ctx *simulator.Context,
	req *types.QueryAgency) soap.HasFault

func (*EsxAgentManager) ScanForUnknownAgentVm

func (m *EsxAgentManager) ScanForUnknownAgentVm(
	ctx *simulator.Context,
	req *types.ScanForUnknownAgentVm) soap.HasFault

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL