testing finished
This commit is contained in:
parent
6615285d63
commit
ce6f0ae5e4
|
@ -381,7 +381,7 @@ func resourceVSphereVirtualMachineRead(d *schema.ResourceData, meta interface{})
|
||||||
var mvm mo.VirtualMachine
|
var mvm mo.VirtualMachine
|
||||||
|
|
||||||
collector := property.DefaultCollector(client.Client)
|
collector := property.DefaultCollector(client.Client)
|
||||||
if err := collector.RetrieveOne(context.TODO(), vm.Reference(), []string{"guest", "summary", "datastore"}, &mvm); err != nil {
|
if err := collector.RetrieveOne(context.TODO(), vm.Reference(), []string{"guest", "summary", "datastore","config.extraConfig"}, &mvm); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -437,21 +437,18 @@ func resourceVSphereVirtualMachineRead(d *schema.ResourceData, meta interface{})
|
||||||
d.Set("memory", mvm.Summary.Config.MemorySizeMB)
|
d.Set("memory", mvm.Summary.Config.MemorySizeMB)
|
||||||
d.Set("cpu", mvm.Summary.Config.NumCpu)
|
d.Set("cpu", mvm.Summary.Config.NumCpu)
|
||||||
|
|
||||||
log.Printf("[DEBUG] ===============================")
|
|
||||||
//log.Printf("[DEBUG] Get extra config ===============================")
|
|
||||||
//log.Printf("[DEBUG] Get extra config %v", mvm.Config)
|
|
||||||
//log.Printf("[DEBUG] Get extra config %v", mvm.Config.ExtraConfig)
|
|
||||||
if mvm.Config != nil && mvm.Config.ExtraConfig != nil && len(mvm.Config.ExtraConfig) > 0 {
|
if mvm.Config != nil && mvm.Config.ExtraConfig != nil && len(mvm.Config.ExtraConfig) > 0 {
|
||||||
log.Printf("[DEBUG] reading custom configs")
|
//TODO: can only set specific custom value, not everything
|
||||||
custom_configs := make(map[string]types.AnyType)
|
//Would need the config here
|
||||||
|
//custom_configs := make(map[string]types.AnyType)
|
||||||
for _, v := range mvm.Config.ExtraConfig {
|
for _, v := range mvm.Config.ExtraConfig {
|
||||||
value := v.GetOptionValue()
|
value := v.GetOptionValue()
|
||||||
custom_configs[value.Key] = value.Value
|
//custom_configs[value.Key] = value.Value
|
||||||
log.Printf("[DEBUG] reading custom configs %s,%s",value.Key, value.Value)
|
log.Printf("[DEBUG] custom configs %s,%s",value.Key, value.Value)
|
||||||
}
|
}
|
||||||
d.Set("custom_configuration_parameters", custom_configs)
|
//d.Set("custom_configuration_parameters", custom_configs)
|
||||||
}
|
}
|
||||||
log.Printf("[DEBUG] ===============================")
|
|
||||||
d.Set("datastore", rootDatastore)
|
d.Set("datastore", rootDatastore)
|
||||||
|
|
||||||
// Initialize the connection info
|
// Initialize the connection info
|
||||||
|
|
Loading…
Reference in New Issue