Documentation ¶
Overview ¶
Package vcsim contains tools for running a VCenter simulator.
Index ¶
- Constants
- Variables
- func ClusterName(datacenter, cluster int) string
- func ClusterPath(datacenter, cluster int) string
- func DatacenterName(datacenter int) string
- func DatastoreName(datastore int) string
- func DatastorePath(datacenter, datastore int) string
- func DistributedPortGroupName(datacenter int, distributedPortGroup int) string
- func NetworkFolderName(datacenter int) string
- func NetworkPath(datacenter int, network string) string
- func ResourcePoolPath(datacenter, cluster int) string
- func VMFolderName(datacenter int) string
- func VMPath(datacenter int, vm string) string
- type Builder
- type Simulator
Constants ¶
const ( // DefaultNetworkName is the name of the default network that exists when starting a new vcsim instance. DefaultNetworkName = "VM Network" // DefaultStoragePolicyName is the name of the default storage policy that exists when starting a new vcsim instance. DefaultStoragePolicyName = "vSAN Default Storage Policy" )
Variables ¶
var ( // DefaultVMTemplates is the name of the default VM templates the vcsim controller adds to new vcsim instance. // Note: There are no default templates when starting a new vcsim instance. // Note: For the sake of testing with vcsim the template doesn't really matter (nor the version of K8s hosted on it) // but we must provide at least the templates that are expected by test cluster classes. DefaultVMTemplates = []string{ "ubuntu-2204-kube-v1.28.0", "ubuntu-2204-kube-v1.29.0", "ubuntu-2204-kube-v1.30.0", "ubuntu-2404-kube-v1.31.0", } )
Functions ¶
func ClusterName ¶ added in v1.10.0
ClusterName provide a function to compute vcsim cluster names given its index and the index of a datacenter.
func ClusterPath ¶ added in v1.10.0
ClusterPath provides the path for a vcsim cluster given its index and the index of a datacenter.
func DatacenterName ¶ added in v1.10.0
DatacenterName provide a function to compute vcsim datacenter names given its index.
func DatastoreName ¶ added in v1.10.0
DatastoreName provide a function to compute vcsim datastore names given its index.
func DatastorePath ¶ added in v1.10.0
DatastorePath provides the path for a vcsim datastore given its index and the index of a datacenter.
func DistributedPortGroupName ¶ added in v1.10.0
DistributedPortGroupName provide a function to compute vcsim distribute port group names in a datacenter.
func NetworkFolderName ¶ added in v1.10.0
NetworkFolderName provide a function to compute vcsim network folder name names given the index of a datacenter.
func NetworkPath ¶ added in v1.10.0
NetworkPath provides the path for a vcsim network given the index of a datacenter and the network name.
func ResourcePoolPath ¶ added in v1.10.0
ResourcePoolPath provides the path for a vcsim Resources folder given the index of a datacenter and the index of a cluster.
func VMFolderName ¶ added in v1.10.0
VMFolderName provide a function to compute vcsim vm folder name names given the index of a datacenter.
Types ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
Builder helps in creating a vcsim simulator.
func (*Builder) SkipModelCreate ¶ added in v1.10.0
SkipModelCreate tells the builder to skip creating the model, because it is already created before passing it to WithModel.
func (*Builder) WithModel ¶
WithModel defines the model to be used by the Builder when creating the vcsim instance.
func (*Builder) WithOperations ¶
WithOperations defines the operation that the Builder should executed on the newly created vcsim instance.