2018-03-20 19:03:47 -04:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
2020-01-07 19:59:31 -05:00
|
|
|
"github.com/hashicorp/packer/builder/vsphere/driver"
|
2018-03-20 19:03:47 -04:00
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
2018-10-31 17:42:24 -04:00
|
|
|
d, err := driver.NewDriver(&driver.ConnectConfig{
|
2018-03-20 19:03:47 -04:00
|
|
|
VCenterServer: "vcenter.vsphere65.test",
|
|
|
|
Username: "root",
|
|
|
|
Password: "jetbrains",
|
|
|
|
InsecureConnection: true,
|
|
|
|
})
|
|
|
|
if err != nil {
|
|
|
|
panic(err)
|
|
|
|
}
|
|
|
|
|
|
|
|
ds, err := d.FindDatastore("", "esxi-1.vsphere65.test")
|
|
|
|
if err != nil {
|
|
|
|
panic(err)
|
|
|
|
}
|
|
|
|
|
|
|
|
fmt.Println(ds.Name())
|
|
|
|
}
|