Exemple #1
0
func (d *Dispatcher) GetVCHConfig(vm *vm.VirtualMachine) (*config.VirtualContainerHostConfigSpec, error) {
	defer trace.End(trace.Begin(""))

	//this is the appliance vm
	mapConfig, err := vm.FetchExtraConfigBaseOptions(d.ctx)
	if err != nil {
		err = errors.Errorf("Failed to get VM extra config of %q: %s", vm.Reference(), err)
		log.Error(err)
		return nil, err
	}

	data := vmomi.OptionValueSource(mapConfig)
	vchConfig := &config.VirtualContainerHostConfigSpec{}
	result := extraconfig.Decode(data, vchConfig)
	if result == nil {
		err = errors.Errorf("Failed to decode VM configuration %q: %s", vm.Reference(), err)
		log.Error(err)
		return nil, err
	}

	//	vchConfig.ID
	return vchConfig, nil
}