id
stringlengths
2
7
text
stringlengths
17
51.2k
title
stringclasses
1 value
c170000
condition (including nil from the closure of the // callback error channel on success). We also use a different context so // that we can give a better error message on timeout without interfering // with the subscriber's context. ctx, cancel := context.WithTimeout(context.Background(), time.Duration(timeout)*time.Minute) defer cancel() var err error select { case <-ctx.Done(): if ctx.Err() == context.DeadlineExceeded { err = fmt.Errorf("timeout waiting for customization to complete") } case err = <-mgrErr: case err = <-cbErr: } return err }
c170001
ref, Recursion: types.EventFilterSpecRecursionOptionAll, }, EventTypeId: eventTypes, } mgr := event.NewManager(client.Client) return mgr.QueryEvents(ctx, filter) }
c170002
} else { dso, err := f.DefaultDatastore(context.TODO()) return dso, err } }
c170003
log.Printf("[DEBUG] %s: Reconfiguring virtual machine through Storage DRS API", resourceVSphereVirtualMachineIDString(d)) pod, err := storagepod.FromID(client, d.Get("datastore_cluster_id").(string)) if err != nil { return fmt.Errorf("error getting datastore cluster: %s", err) } err = storagepod.ReconfigureVM(client, vm, spec, pod) if err != nil { return fmt.Errorf("error reconfiguring VM on datastore cluster %q: %s", pod.Name(), err) } return nil }
c170004
use datastore_cluster_id: %s", err) } log.Printf("[DEBUG] %s: Creating virtual machine through Storage DRS API", resourceVSphereVirtualMachineIDString(d)) pod, err := storagepod.FromID(client, d.Get("datastore_cluster_id").(string)) if err != nil { return nil, fmt.Errorf("error getting datastore cluster: %s", err) } vm, err := storagepod.CreateVM(client, fo, spec, pool, hs, pod) if err != nil { return nil, fmt.Errorf("error creating virtual machine on datastore cluster %q: %s", pod.Name(), err) } return vm, nil }
c170005
the VM. ds, err := datastore.FromID(client, d.Get("datastore_id").(string)) if err != nil { return nil, fmt.Errorf("error locating datastore for VM: %s", err) } spec.Files = &types.VirtualMachineFileInfo{ VmPathName: fmt.Sprintf("[%s]", ds.Name()), } vm, err := virtualmachine.Create(client, fo, spec, pool, hs) if err != nil { return nil, fmt.Errorf("error creating virtual machine: %s", err) } return vm, nil }
c170006
API", resourceVSphereVirtualMachineIDString(d)) pod, err := storagepod.FromID(client, d.Get("datastore_cluster_id").(string)) if err != nil { return nil, fmt.Errorf("error getting datastore cluster: %s", err) } vm, err := storagepod.CloneVM(client, srcVM, fo, name, spec, timeout, pod) if err != nil { return nil, fmt.Errorf("error cloning on datastore cluster %q: %s", pod.Name(), err) } return vm, nil }
c170007
if err := resourceVSphereVirtualMachineDelete(d, meta); err != nil { return fmt.Errorf(formatVirtualMachinePostCloneRollbackError, vm.InventoryPath, origErr, err) } return fmt.Errorf("error reconfiguring virtual machine: %s", origErr) }
c170008
resourceVSphereVirtualMachineIDString(d)) pod, err := storagepod.FromID(client, d.Get("datastore_cluster_id").(string)) if err != nil { return fmt.Errorf("error getting datastore cluster: %s", err) } err = storagepod.RelocateVM(client, vm, spec, timeout, pod) if err != nil { return fmt.Errorf("error running vMotion on datastore cluster %q: %s", pod.Name(), err) } return nil }
c170009
err } spec = virtualdevice.AppendDeviceChangeSpec(spec, delta...) // CDROM l, delta, err = virtualdevice.CdromApplyOperation(d, c, l) if err != nil { return nil, err } spec = virtualdevice.AppendDeviceChangeSpec(spec, delta...) log.Printf("[DEBUG] %s: Final device list: %s", resourceVSphereVirtualMachineIDString(d), virtualdevice.DeviceListString(l)) log.Printf("[DEBUG] %s: Final device change spec: %s", resourceVSphereVirtualMachineIDString(d), virtualdevice.DeviceChangeString(spec)) return spec, nil }
c170010
Behavior: types.DpmBehavior(d.Get("dpm_automation_level").(string)), Enabled: structure.GetBool(d, "dpm_enabled"), Key: host.Reference(), } return obj, nil }
c170011
error { return structure.SetBatch(d, map[string]interface{}{ "dpm_automation_level": obj.Behavior, "dpm_enabled": obj.Enabled, }) }
c170012
return strings.Join([]string{cluster.Reference().Value, host.Reference().Value}, ":"), nil }
c170013
== host.Reference() { log.Printf("[DEBUG] Found DPM config info for host %q in cluster %q", host.Name(), cluster.Name()) return &info, nil } } log.Printf("[DEBUG] No DPM config info found for host %q in cluster %q", host.Name(), cluster.Name()) return nil, nil }
c170014
to specify this in later versions Deprecated: "this attribute has no effect on controller types - please use scsi_type in vsphere_virtual_machine instead", ValidateFunc: func(v interface{}, k string) (ws []string, errors []error) { value := v.(string) if value != "ide" && value != "busLogic" && value != "lsiLogic" { errors = append(errors, fmt.Errorf( "only 'ide', 'busLogic', and 'lsiLogic' are supported values for 'adapter_type'")) } return }, }, "datacenter": { Type: schema.TypeString, Optional: true, ForceNew: true, }, "create_directories": { Type: schema.TypeBool, Optional: true, ForceNew: true, }, }, } }
c170015
if err != nil { return err } log.Printf("[DEBUG] Disk spec: %v", spec) task, err := virtualDiskManager.CreateVirtualDisk(context.TODO(), diskPath, datacenter, spec) if err != nil { return err } _, err = task.WaitForResult(context.TODO(), nil) if err != nil { log.Printf("[INFO] Failed to create disk: %v", err) return err } log.Printf("[INFO] Created disk.") return nil }
c170016
if info == nil || info.Error != nil { _, ok := info.Error.Fault.(*types.FileNotFound) if ok { log.Printf("[DEBUG] searchForDirectory - could not find: %v", directoryPath) return nil } } log.Printf("[DEBUG] searchForDirectory - could not search datastore for: %v", directoryPath) return err } res := info.Result.(types.HostDatastoreBrowserSearchResults) log.Printf("[DEBUG] num results: %d", len(res.File)) if len(res.File) == 0 { log.Printf("[DEBUG] searchForDirectory - could not find: %v", directoryPath) return nil } if len(res.File) != 1 { return errors.New("Datastore search did not return exactly one result") } fileInfo := res.File[0] log.Printf("[DEBUG] searchForDirectory - fileinfo: %#v", fileInfo) return nil }
c170017
context.WithTimeout(context.Background(), defaultAPITimeout) defer cancel() ds, err := dss.CreateNasDatastore(ctx, *p.volSpec) if err != nil { return p.ds, fmt.Errorf("host %q: %s", hostsystem.NameOrID(p.client, hsID), err) } if err := p.validateDatastore(ds); err != nil { return p.ds, fmt.Errorf("datastore validation error on host %q: %s", hostsystem.NameOrID(p.client, hsID), err) } } return p.ds, nil }
c170018
hsID), err) } if err := removeDatastore(dss, p.ds); err != nil { return fmt.Errorf("host %q: %s", hostsystem.NameOrID(p.client, hsID), err) } } return nil }
c170019
if !clientVer.ProductEqual(tagsMinVersion) || clientVer.Older(tagsMinVersion) { return false } return true }
c170020
unique, empirical observation via the console and API show that they // are. If for some reason the returned results includes more than one ID, // we give an error, indicating that this is a bug and the user should // submit an issue. return "", fmt.Errorf(vSphereTagCategorySearchErrMultiple, name) } return cats[0].ID, nil }
c170021
1 { // This situation is very similar to the one in tagCategoryByName. The API // docs even say that tags need to be unique in categories, yet // GetTagByNameForCategory still returns multiple results. return "", fmt.Errorf(vSphereTagSearchErrMultiple, name) } return tags[0].ID, nil }
c170022
object.", Optional: true, Elem: &schema.Schema{Type: schema.TypeString}, } }
c170023
return vSphereTagTypeDatacenter, nil case *object.ClusterComputeResource: return vSphereTagTypeClusterComputeResource, nil case *object.HostSystem: return vSphereTagTypeHostSystem, nil case *object.StoragePod: return vSphereTagTypeStoragePod, nil case *object.ResourcePool: return vSphereTagTypeResourcePool, nil case *object.VirtualApp: return vSphereTagTypeVirtualApp, nil } return "", fmt.Errorf("unsupported type for tagging: %T", obj) }
c170024
log.Printf("[DEBUG] Tags for object %q: %s", objID, strings.Join(ids, ",")) if err != nil { return err } if err := d.Set(vSphereTagAttributeKey, ids); err != nil { return fmt.Errorf("error saving tag IDs to resource data: %s", err) } return nil }
c170025
v1 == v2 { found = true } } if !found { c = append(c, v1) } found = false } return c }
c170026
ctx, cancel := context.WithTimeout(context.Background(), defaultAPITimeout) defer cancel() log.Printf("[DEBUG] Attaching tag %q for object %q", tagID, objID) if err := p.client.AttachTagToObject(ctx, tagID, objID, objType); err != nil { return err } } return nil }
c170027
if err != nil { return nil, err } return client, nil } log.Printf("[DEBUG] tagsClientIfDefined: No tags configured, skipping loading of tagging client") return nil, nil }
c170028
return fmt.Errorf("error detaching tags to object ID %q: %s", obj.Reference().Value, err) } if err := tdp.processAttachOperations(); err != nil { return fmt.Errorf("error attaching tags to object ID %q: %s", obj.Reference().Value, err) } return nil }
c170029
d.Get("contact_name").(string), Contact: d.Get("contact_detail").(string), } return obj }
c170030
obj.Name) d.Set("conatct_detail", obj.Contact) return nil }
c170031
PnicDevice: nic, } pnSpecs = append(pnSpecs, pnSpec) } backing := types.DistributedVirtualSwitchHostMemberPnicBacking{ PnicSpec: pnSpecs, } obj := types.DistributedVirtualSwitchHostMemberConfigSpec{ Host: *hostRef, Backing: &backing, } return obj }
c170032
:= obj.Config.Backing.(*types.DistributedVirtualSwitchHostMemberPnicBacking) for _, spec := range backing.PnicSpec { devices = append(devices, spec.PnicDevice) } d["devices"] = devices return d }
c170033
} // Process new hosts now. These are ones that are only present in the new // set. for _, ne := range ns.List() { nm := ne.(map[string]interface{}) var found bool for _, oe := range os.List() { om := oe.(map[string]interface{}) if om["host_system_id"] == nm["host_system_id"] { found = true } } spec := expandDistributedVirtualSwitchHostMemberConfigSpec(nm) if !found { spec.Operation = string(types.ConfigSpecOperationAdd) } else { spec.Operation = string(types.ConfigSpecOperationEdit) } specs = append(specs, spec) } // Done! return specs }
c170034
[]map[string]interface{} for _, m := range members { hosts = append(hosts, flattenDistributedVirtualSwitchHostMember(m)) } if err := d.Set("host", hosts); err != nil { return err } return nil }
c170035
InternalFlowsOnly: d.Get("netflow_internal_flows_only").(bool), ObservationDomainId: int64(d.Get("netflow_observation_domain_id").(int)), SamplingRate: int32(d.Get("netflow_sampling_rate").(int)), } return obj }
c170036
d.Set("netflow_collector_port", obj.CollectorPort) d.Set("netflow_idle_flow_timeout", obj.IdleFlowTimeout) d.Set("netflow_internal_flows_only", obj.InternalFlowsOnly) d.Set("netflow_observation_domain_id", obj.ObservationDomainId) d.Set("netflow_sampling_rate", obj.SamplingRate) return nil }
c170037
structure.SetInt64Ptr(d, maxMbitKey, obj.AllocationInfo.Limit) structure.SetInt64Ptr(d, resMbitKey, obj.AllocationInfo.Reservation) if obj.AllocationInfo.Shares != nil { d.Set(shareLevelKey, obj.AllocationInfo.Shares.Level) d.Set(shareCountKey, obj.AllocationInfo.Shares.Shares) } return nil }
c170038
UplinkPortName: structure.SliceInterfacesToStrings(d.Get("uplinks").([]interface{})), } if structure.AllFieldsEmpty(obj) { return nil } return obj }
c170039
error { if err := d.Set("uplinks", obj.UplinkPortName); err != nil { return err } return nil }
c170040
d.Get("network_resource_control_version").(string), UplinkPortPolicy: expandDVSNameArrayUplinkPortPolicy(d), }, MaxMtu: int32(d.Get("max_mtu").(int)), LinkDiscoveryProtocolConfig: expandLinkDiscoveryProtocolConfig(d), IpfixConfig: expandVMwareIpfixConfig(d), LacpApiVersion: d.Get("lacp_api_version").(string), MulticastFilteringMode: d.Get("multicast_filtering_mode").(string), } return obj }
c170041
return err } if err := flattenVMwareDVSPortSetting(d, obj.DefaultPortConfig.(*types.VMwareDVSPortSetting)); err != nil { return err } if err := flattenSliceOfDistributedVirtualSwitchHostMember(d, obj.Host); err != nil { return err } if err := flattenSliceOfDvsHostInfrastructureTrafficResource(d, obj.InfrastructureTrafficResourceConfig); err != nil { return err } if err := flattenDVSContactInfo(d, obj.Contact); err != nil { return err } if err := flattenLinkDiscoveryProtocolConfig(d, obj.LinkDiscoveryProtocolConfig); err != nil { return err } if err := flattenVMwareIpfixConfig(d, obj.IpfixConfig); err != nil { return err } return nil }
c170042
true, Description: "The version of this virtual switch. Allowed versions are 6.5.0, 6.0.0, 5.5.0, 5.1.0, and 5.0.0.", Optional: true, ValidateFunc: validation.StringInSlice(dvsVersions, false), }, } structure.MergeSchema(s, schemaVMwareDVSConfigSpec()) return s }
c170043
expander/flattener for it. Just do that here. obj := types.DVSCreateSpec{ ProductInfo: &types.DistributedVirtualSwitchProductSpec{ Version: d.Get("version").(string), }, ConfigSpec: expandVMwareDVSConfigSpec(d), } return obj }
c170044
%s: Resource argument %q requires a VM restart", resourceVSphereVirtualMachineIDString(d), key) d.Set("reboot_required", true) } return d.Get(key) }
c170045
from OVF templates which have customizable vApp properties.", Elem: &schema.Schema{Type: schema.TypeString}, }, } }
c170046
are on vSphere 6.5 and higher version := viapi.ParseVersionFromClient(client) if version.Newer(viapi.VSphereVersion{Product: version.Product, Major: 6, Minor: 5}) { obj.EfiSecureBootEnabled = getBoolWithRestart(d, "efi_secure_boot_enabled") } return obj }
c170047
structure.SetBoolPtr(d, "boot_retry_enabled", obj.BootRetryEnabled) d.Set("boot_retry_delay", obj.BootRetryDelay) return nil }
c170048
getWithRestart(d, "ept_rvi_mode").(string), EnableLogging: getBoolWithRestart(d, "enable_logging"), } return obj }
c170049
d.Set("ept_rvi_mode", obj.VirtualMmuUsage) d.Set("enable_logging", obj.EnableLogging) return nil }
c170050
"run_tools_scripts_before_guest_standby"), BeforeGuestShutdown: getBoolWithRestart(d, "run_tools_scripts_before_guest_shutdown"), BeforeGuestReboot: getBoolWithRestart(d, "run_tools_scripts_before_guest_reboot"), } return obj }
c170051
d.Set("run_tools_scripts_after_resume", obj.AfterResume) d.Set("run_tools_scripts_before_guest_standby", obj.BeforeGuestStandby) d.Set("run_tools_scripts_before_guest_shutdown", obj.BeforeGuestShutdown) d.Set("run_tools_scripts_before_guest_reboot", obj.BeforeGuestReboot) return nil }
c170052
&schema.Schema{ Type: schema.TypeInt, Optional: true, Computed: true, Description: fmt.Sprintf(shareCountFmt, t), ValidateFunc: validation.IntAtLeast(0), } s[limitKey] = &schema.Schema{ Type: schema.TypeInt, Optional: true, Default: -1, Description: fmt.Sprintf(limitFmt, t), ValidateFunc: validation.IntAtLeast(-1), } s[reservationKey] = &schema.Schema{ Type: schema.TypeInt, Optional: true, Description: fmt.Sprintf(reservationFmt, t), ValidateFunc: validation.IntAtLeast(0), } } return s }
c170053
limitKey), Reservation: structure.GetInt64PtrEmptyZero(d, reservationKey), } shares := &types.SharesInfo{ Level: types.SharesLevel(d.Get(shareLevelKey).(string)), Shares: int32(d.Get(shareCountKey).(int)), } obj.Shares = shares return obj }
c170054
types.LatencySensitivitySensitivityLevel(d.Get("latency_sensitivity").(string)), } return obj }
c170055
read LatencySensitivity, skipping") return nil } return d.Set("latency_sensitivity", obj.Level) }
c170056
limitKey := fmt.Sprintf("%s_limit", key) reservationKey := fmt.Sprintf("%s_reservation", key) structure.SetInt64Ptr(d, limitKey, obj.Limit) structure.SetInt64Ptr(d, reservationKey, obj.Reservation) if obj.Shares != nil { d.Set(shareLevelKey, obj.Shares.Level) d.Set(shareCountKey, obj.Shares.Shares) } return nil }
c170057
range props { if v.Value != "" && v.Value != v.DefaultValue { vac[v.Id] = v.Value } } // Only set if properties exist to prevent creating an unnecessary diff if len(vac) > 0 { return d.Set("vapp", []interface{}{ map[string]interface{}{ "properties": vac, }, }) } return nil }
c170058
CpuHotRemoveEnabled: getBoolWithRestart(d, "cpu_hot_remove_enabled"), CpuAllocation: expandVirtualMachineResourceAllocation(d, "cpu"), MemoryAllocation: expandVirtualMachineResourceAllocation(d, "memory"), MemoryReservationLockedToMax: getMemoryReservationLockedToMax(d), ExtraConfig: expandExtraConfig(d), SwapPlacement: getWithRestart(d, "swap_placement_policy").(string), BootOptions: expandVirtualMachineBootOptions(d, client), VAppConfig: vappConfig, Firmware: getWithRestart(d, "firmware").(string), NestedHVEnabled: getBoolWithRestart(d, "nested_hv_enabled"), VPMCEnabled: getBoolWithRestart(d, "cpu_performance_counters_enabled"), LatencySensitivity: expandLatencySensitivity(d), } return obj, nil }
c170059
} if err := flattenExtraConfig(d, obj.ExtraConfig); err != nil { return err } if err := flattenVAppConfig(d, obj.VAppConfig); err != nil { return err } if err := flattenLatencySensitivity(d, obj.LatencySensitivity); err != nil { return err } // This method does not operate any different than the above method but we // return its error result directly to ensure there are no warnings in the // linter. It's awkward, but golint does not allow setting exceptions. return flattenVirtualMachineBootOptions(d, obj.BootOptions) }
c170060
return types.VirtualMachineConfigSpec{}, false, err } log.Printf("[DEBUG] %s: Expanding of old config complete", resourceVSphereVirtualMachineIDString(d)) newSpec, err := expandVirtualMachineConfigSpec(d, client) if err != nil { return types.VirtualMachineConfigSpec{}, false, err } // Return the new spec and compare return newSpec, !reflect.DeepEqual(oldSpec, newSpec), nil }
c170061
!= d.Get("memory").(int) { return structure.BoolPtr(false) } return nil }
c170062
case "VirtualCenter": if dc != nil { finder.SetDatacenter(dc) } if name != "" { return finder.ResourcePool(ctx, name) } return finder.DefaultResourcePool(ctx) } return nil, fmt.Errorf("unsupported ApiType: %s", t) }
c170063
if err := obj.Properties(ctx, obj.Reference(), nil, &props); err != nil { return nil, err } return &props, nil }
c170064
for _, href := range cprops.Host { if href.Value == host.Reference().Value { log.Printf("[DEBUG] Validated that host %q is a member of resource pool %q.", host.Reference().Value, pool.Reference().Value) return nil } } return fmt.Errorf("host ID %q is not a member of resource pool %q", host.Reference().Value, pool.Reference().Value) }
c170065
OS family for guest ID %q", guest) pprops, err := Properties(pool) if err != nil { return "", err } return computeresource.OSFamily(client, pprops.Owner, guest) }
c170066
rp.InventoryPath, name)) ctx, cancel := context.WithTimeout(context.Background(), provider.DefaultAPITimeout) defer cancel() nrp, err := rp.Create(ctx, name, *spec) if err != nil { return nil, err } return nrp, nil }
c170067
pool %q", fmt.Sprintf("%s", rp.InventoryPath)) ctx, cancel := context.WithTimeout(context.Background(), provider.DefaultAPITimeout) defer cancel() return rp.UpdateConfig(ctx, name, spec) }
c170068
context.WithTimeout(context.Background(), provider.DefaultAPITimeout) defer cancel() _, err := methods.MoveIntoResourcePool(ctx, p.Client(), &req) return err }
c170069
obj := &types.ClusterDasVmConfigInfo{ DasSettings: expandClusterDasVMSettings(d, version), Key: vm.Reference(), } // Expand ha_vm_monitoring_use_cluster_defaults here as it's not included in // the base vsphere_compute_cluster resource. obj.DasSettings.VmToolsMonitoringSettings.ClusterSettings = structure.GetBool(d, "ha_vm_monitoring_use_cluster_defaults") return obj, nil }
c170070
if err := d.Set("ha_vm_monitoring_use_cluster_defaults", obj.DasSettings.VmToolsMonitoringSettings.ClusterSettings); err != nil { return err } return flattenClusterDasVMSettings(d, obj.DasSettings, version) }
c170071
off of properties of virtual machine: %s", err) } vmID := props.Config.Uuid return strings.Join([]string{clusterID, vmID}, ":"), nil }
c170072
info.Key == vm.Reference() { log.Printf("[DEBUG] Found HA config info for VM %q in cluster %q", vm.Name(), cluster.Name()) return &info, nil } } log.Printf("[DEBUG] No HA config info found for VM %q in cluster %q", vm.Name(), cluster.Name()) return nil, nil }
c170073
own tagging.", Default: 0, ValidateFunc: validation.IntBetween(0, 4095), }, "virtual_switch_name": { Type: schema.TypeString, Required: true, Description: "The name of the virtual switch to bind this port group to.", ForceNew: true, }, } structure.MergeSchema(s, schemaHostNetworkPolicy()) return s }
c170074
d.Get("name").(string), VlanId: int32(d.Get("vlan_id").(int)), VswitchName: d.Get("virtual_switch_name").(string), Policy: *expandHostNetworkPolicy(d), } return obj }
c170075
{ d.Set("vlan_id", obj.VlanId) if err := flattenHostNetworkPolicy(d, &obj.Policy); err != nil { return err } return nil }
c170076
structure.SliceStringsToInterfaces(port.Mac) m["type"] = port.Type s = append(s, m) } return schema.NewSet(schema.HashResource(portGroupPortSchema()), s) }
c170077
Description: "The MAC addresses of the network service of the virtual machine connected on this port.", Computed: true, Elem: &schema.Schema{Type: schema.TypeString}, }, "type": { Type: schema.TypeString, Description: "Type type of the entity connected on this port. Possible values are host (VMKkernel), systemManagement (service console), virtualMachine, or unknown.", Computed: true, }, }, } }
c170078
string) { d.SetId(fmt.Sprintf("%s:%s:%s", hostPortGroupIDPrefix, hsID, name)) }
c170079
return splitHostPortGroupID(d.Id()) }
c170080
> 1 { return nil, fmt.Errorf("multiple results returned for path %q", path) } if !strings.HasSuffix(list[0].Path, path) { return nil, fmt.Errorf("returned object path %q does not properly match search path %q", list[0].Path, path) } return BaseFromReference(client, list[0].Object.Reference()) }
c170081
return StandaloneFromID(client, ref.Value) } return nil, fmt.Errorf("unknown object type %s", ref.Type) }
c170082
if err := obj.Properties(ctx, obj.Reference(), nil, &props); err != nil { return nil, err } return &props, nil }
c170083
error) { obj, err := BaseFromReference(client, ref) if err != nil { return nil, err } return BaseProperties(obj) }
c170084
!= nil { return nil, err } ctx, cancel := context.WithTimeout(context.Background(), provider.DefaultAPITimeout) defer cancel() return b.DefaultDevices(ctx, "", nil) }
c170085
context.WithTimeout(context.Background(), provider.DefaultAPITimeout) defer cancel() return b.OSFamily(ctx, guest) }
c170086
host, cluster, and vSphere license health of all associated resources and try again", cr, ) } return envbrowse.NewEnvironmentBrowser(client.Client, *props.EnvironmentBrowser), nil }
c170087
if err := cluster.Properties(ctx, cluster.Reference(), nil, &props); err != nil { return nil, err } return &props, nil }
c170088
f.InventoryPath, name)) ctx, cancel := context.WithTimeout(context.Background(), provider.DefaultAPITimeout) defer cancel() cluster, err := f.CreateCluster(ctx, name, spec) if err != nil { return nil, err } return cluster, nil }
c170089
if err != nil { return err } return folder.MoveObjectTo(cluster.Reference(), f) }
c170090
return computeresource.Reconfigure(cluster, spec) }
c170091
ctx, cancel := context.WithTimeout(context.Background(), provider.DefaultAPITimeout) defer cancel() task, err := cluster.Destroy(ctx) if err != nil { return err } return task.Wait(ctx) }
c170092
== nil { return false, nil } if *hprops.Parent != cluster.Reference() { return false, nil } return true, nil }
c170093
Host: hsRefs, } ctx, cancel := context.WithTimeout(context.Background(), provider.DefaultAPITimeout) defer cancel() resp, err := methods.MoveInto_Task(ctx, cluster.Client(), &req) if err != nil { return err } task := object.NewTask(cluster.Client(), resp.Returnval) return task.Wait(ctx) }
c170094
error { for _, host := range hosts { if err := moveHostOutOf(cluster, host, timeout); err != nil { return err } } return nil }
c170095
&types.VmwareDistributedVirtualSwitchVlanIdSpec{ VlanId: int32(d.Get("vlan_id").(int)), } return obj }
c170096
obj *types.VmwareDistributedVirtualSwitchVlanIdSpec) error { d.Set("vlan_id", obj.VlanId) return nil }
c170097
%#v", v) r := v.(map[string]interface{}) min := r["min_vlan"].(int) max := r["max_vlan"].(int) rng := types.NumericRange{ Start: int32(min), End: int32(max), } ranges = append(ranges, rng) } if len(ranges) < 1 { return nil } obj := &types.VmwareDistributedVirtualSwitchTrunkVlanSpec{ VlanId: ranges, } return obj }
c170098
m["max_vlan"] = rng.End s = append(s, m) } if err := d.Set("vlan_range", s); err != nil { return err } return nil }
c170099
{ obj := &types.VmwareDistributedVirtualSwitchPvlanSpec{ PvlanId: int32(d.Get("port_private_secondary_vlan_id").(int)), } return obj }