Quantcast
Channel: VMware Communities: Message List
Viewing all 246952 articles
Browse latest View live

xpath filtering VcPlugin.getAllDatacenters(); VcPlugin.getAllClusterComputeResources()

$
0
0

Hello all,

 

I have a workflow that is creating Datacenters and Clusters in a vCenter.

 

It takes inputs through csv file and I use the a loop through the functions VcPlugin.allSdkConnections; VcPlugin.getAllDatacenters(); VcPlugin.getAllClusterComputeResources() to see if the vCenter, Datacenter or Cluster exists and creates it if it doesn't. (except for vCenter obviously)

 

This is all working fine - however now I have an additional requirement in the form of there will be multiple vCenters connected to vRO - and its possible that the Datacenter/Cluster exists but not in the right vCenter. I know I can use xpath to filter as per documentation below but am struggling to get it to work and don't fully get the examples the documentation includes.

 

VMware vRealize Orchestrator 7.2 Documentation Center

 

This is my basic code

 

//Datacenter Section

var value1 = "SomeDatacenter"

var allDcs = VcPlugin.getAllDatacenters();

System.log ("Datacenter Requested = " + value1);

for (var i in allDcs) { 

//Check to see if the Datacenter Exists

  if (allDcs[i].name.match(new RegExp(value1, "i"))) { 

//Datacenter exists set the DatacenterExists attribute to true

DatacenterExists = "True";

  }

//Create Datacenter here

}

 

 

//Cluster Section

var value2 = "SomeCluster"

var allClus = VcPlugin.getAllClusterComputeResources();

System.log ("Cluster Requested = " + value2);

for (var i in allClus) { 

//Check to see if the Cluster Exists

  if (allClus[i].name.match(new RegExp(value2, "i"))) { 

//Cluster exists set the ClusterExists attribute to true

ClusterExists = "True";

  }

//Create Cluster here

}

 

For Step 1 The filter would ensure that the returned Datacenter from VcPlugin.getAllDatacenters(); would be from the right vCenter,

For Step 2 The filter would ensure that the returned Clusters from VcPlugin.getAllClusterComputeResources(); would be from the right Datacenter and vCenter,


Re: 10gbE bottlenecked at 1gbE regardless

$
0
0

I am running into the same issue. vSphere 6.0 Ent Plus on both HP and Cisco UCS, all using 10Gbe on the management network. We recently switched from Veeam (which does Hot Add backups at SAN speed 400MB/s or so) to a vendor called Rubrik. Rubrik does NBD backups only and we are getting capped at around 800mbps (100MB/s) on 10 gig links. Storage is >.5ms latency all flash array. On a host with 1gbps management link, its worse, only 1MB/s. Its almost like something is throttling it based on size of pipe.

Re: vRealize Automation Simple install issue

Finding a backing storage container in the vSphere MOB

$
0
0

I'm running into a bit of a pickle trying to automate creation of VVol datastores. The problem seems to be that when a storage container is created, its not immediately available for use. The following code works fine if you wait a minute before the foreach loop, but I'd like to be a bit more deterministic. What I think should happen is I should query the vSphere MOB for the $scid content which shows up as the "backing storage container" when you go through the process of creating the VVol datastore through the web client. However, I can't, for the life of me, find how to find it. The final use will be for vRO, but the IDE there is painful, so mocking up with PowerCLI first.

 

#Create Storage Container via SF API call
$SFMethodArgs = @{}
$SFMethodArgs.Add("name",$VVolSCName)
$SFAPIResult = Invoke-SFApi -Method "CreateStorageContainer" -Params $SFMethodArgs<#
The storageContainer ID is not in the format VMware wants it
SolidFire Return: a6af2b22-d468-4d89-b73a-3f53c7390da0
VMware wants: vvol:a6af2b22d4684d89-b73a3f53c7390da0
#>


$SFscid = $SFAPIResult.Values.storageContainerID
$t = $SFscid.Split("-")
$scid1 = -join ($t[0..2])
$scid2 = -join ($t[3..4])
$scid = "vvol:"+$scid1+"-"+$scid2


#Create the VVolDatastoreSpec
$spec = New-Object VMware.Vim.HostDatastoreSystemVvolDatastoreSpec
#Set the name and source ID for the VVol Datastore
$spec.name = $VVolDSName
$spec.scId = $scid


#Build the VMHost DatastoreSystem for all hosts so we can mount the VVol to each host
$VMhosts = Get-Cluster $vSphereCluster | Get-VMHost


#Create the VVol datastore on each host in the cluster
foreach ($VMhost in $VMHosts) {
    $vmhostDS = get-view $vmhost.ExtensionData.ConfigManager.DatastoreSystem    $vmhostHDS = $vmhostDS.MoRef.ToString()    $_this = Get-View -Id $vmhostHDS    Write-Host "Creating VVol datastore $($VVolDSName) on $($vmhost)..." -ForegroundColor DarkGray -NoNewline    $_this.CreateVvolDatastore($spec)
}

 

I can get the required data using get-datastore, but that only works if a datastore has already been created. Chicken and egg problem there ;-) The data I want is the URL field.

$ds = get-vmhost "ts-vh-07.ts.local" | get-datastore vrotest3
$ds.ExtensionData.info

VvolDS                 : VMware.Vim.HostVvolVolume
Name                   : vrotest3
Url                    : ds:///vmfs/volumes/vvol:d0acdc04835844b2-999c2511136ea43e/
FreeSpace              : 276546135785472
MaxFileSize            : 8000000491520
MaxVirtualDiskCapacity : 8000000491520
MaxMemoryFileSize      : 9223372036854775807
Timestamp              : 3/23/2017 4:10:28 PM
ContainerId            :

get-datastore will give me the data I need, but only works for storage containers that have already had a VVol datastore bound to them.

 

Any help would be appreciated.

Re: Recover lost files HELP

$
0
0

First, copy the entire virtual machine bundle to another drive (and restore the original file name).

 

Then from terminal, on a machine with fusion installed, run: sudo /Applications/VMware\ Fusion.app/Contents/Library/vmware-vdiskmanager -R [path to vmdk file]

 

If that works, you're good to go.  If it still says it's corrupt, then the only real option is to restore from backup.

Re: after update to 7.2, findAllForType not working with filter

$
0
0

Just to clarify - when you said 'also updated the vro plugin' did you actually mean you updated the vCenter plug-in from build available at Technical preview of vRO vCenter plug-in  for vSphere 6.5  ?

 

We actually have two vCenter plug-ins; one bundled with vRO up to (and including) version 7.2, and a new one that will be bundled with the upcoming vRO 7.3. The new one is also provided as a Technical Preview build in the link above.

 

As the new plug-in is a complete re-implementation, it is possible that the xpath support is not fully implemented yet. I'll double check with the developers working on the new plug-in tomorrow.

Get-Log: The operation has timed out

$
0
0

So we have a script that takes an ESXi host and just does:

 

Connect-Viserver [ESXihostname] -Credential (Import-clixml [credfile])
Get-Log -Bundle -DestinationPath E:\Logs\

 

However, about exactly 5 min after the execution of Get-Log, the cmdlet consistently errors with:

 

Get-Log : 3/23/2017 12:05:02 PM    Get-Log        The operation has timed out At line:1 char:1 + Get-Log -Bundle -DestinationPath E:\Logs\ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~     + CategoryInfo: NotSpecified: (:) [Get-Log], ViError     + FullyQualifiedErrorId : Client20_QueryServiceImpl_WaitForUpdates_ViError,VMware.VimAutomation.ViCore.Cmdlets.Commands.GetLog

And for the life of me, I cannot find a timeout that extends this.

 

Set-PowerCliConfiguration -WebOperationTimeoutSeconds -1
$vmHost | Get-AdvancedSettings -Name 'UserVars.ESXiShellTimeOut'  (equals 0)

$vmHost | Get-AdvancedSettings -Name 'UserVars.ESXiShellInteractiveTimeOut'  (equals 900)

 

There's an old KB about modifying the timeout on the query service, but this applied to vCenter 4, and doesn't seem applicable now. So I'm struggling to find any setting to modify this timeout and allow a Get-Log execution to complete (vSphere client takes just over 15 min to run).

 

Any help would be appreciated.

Get-Log;operation timed out;weboperationtimeoutsecond

Re: Writeable Volumes vs UEM configuration

$
0
0

That's correct. Writable volumes (UIA + Profile) can be used to capture the user data along with any user installed applications.

UEM has lot of additional capabilities for better management of profiles along with dynamic policies that can be applied when user logs in.

User Environment Manager - VMware Products


Re: VMs fail to start on recently upgared ESXi server (6.0 to 6.5) Transport (VMDB) error -45: Failed to connect to peer process.

Update Manager Missing

$
0
0

I have installed Update Manager on the same server as my VCenter server. Seems to have installed fine. Service is running. Problem is when I log into web client, it is not under Monitoring. Plug-in also isn't showing under plug-ins. I have tried re-registering it with the utility....nothing. Anyone know what I am missing here? Thanks.

Re: Another instance of the component is already installed on this server.

$
0
0

I have just hit this couple of days ago, and documented my fix at: vRA Installation Error: Another instance of the component is already installed on this server.

I thought to share in case anyone else hit it. The issue basically that your previously failed vRA installation did not remove all the components it tried to install. Try to remove them using Add/Remove programs and try again. See my blog post for more details.

 

Cheers,

Eiad Al-Aqqad

B: http://www.VirtualizationTeam.com

T: @VirtualizationT

Re: Why does VMRC sometimes open as a very small window

$
0
0

BlueCorps, I think you're seeing a different problem. It is likely caused by the high DPI/PPI monitor of the Surface Pro 3 (2736 x 1824 pixels on a 12.3” screen gives 267 PPI); Windows was originally designed to 96 dpi. VMRC 9.0 doesn't work with  Windows' automatic high-DPI scaling. We're looking to improve this for a future release.

Re: Update Manager Missing

Re: after update to 7.2, findAllForType not working with filter

$
0
0

Yes. the linked plugin is the one i updated to. I downloaded the .dar file from the appliance before updating so in theory I can just put it back if need be? (I'm preparing for a vCenter 6.5 update and I know getting the vco to show properly seems to need this version although I currently don't have the icon in vcenter 6 at the moment and don't know exactly why)

 

I also noticed that the vro seems to evaluate null differently. I currently have a check to see if somethig is >= "0" or <0 and it failed because null passed the >=0 check whereas befroe it would fail. Minor workaround required but just something different i noticed.

Re: Get-Log: The operation has timed out

$
0
0

Did you do a Get-PowerCLIConfiguration after the Set-?

 

What value does this show after the Connect-ViServer?

 

$global:DefaultVIServer.ExtensionData.Client.ServiceTimeout

 


Re: AlarmManager.createAlarm() API changes since 6.0

$
0
0

This is resolved, I managed to pull it to work by specifying a dynamic perfMetricId and assigning it to a alarm expression. 

Key:150
PerfCounter:netthroughput.provisioned.average
Level:4
StatsType:absolute
UnitInfo:kiloBytesPerSecond

 

In this case the Key value of this perfCounter differs across vcenters (despite the vsphere version it runs), you should always query for the PerfCounter Key instead of using a static int value.

Re: xpath filtering VcPlugin.getAllDatacenters(); VcPlugin.getAllClusterComputeResources()

$
0
0

Hi,

 

I'm not sure that xpath filtering will help in this case.

 

The good news is that you don't need to use VcPlugin.getAllDatacenters() or VcPlugin.getAllClusterComputeResources(). what you need is a few nested loops like in the following pseudo code:

 

for each (var vcenter in VcPlugin.allSdkConnections) { // iterate over all vCenter servers    for each (var datacenter in vcenter.allDatacenters) { // iterate over all datacenters inside the given vCenter        var clusters = getClustersInDatacenter(datacenter); // get all clusters inside the given datacenter        for each (var cluster in clusters) {            // use the cluster object        }    }
}

 

That is, you won't iterate over all possible vCenters/datacenters/clusters; you would iterate over the objects within the desired scope, so no filtering is needed.

 

What will remain in the code above is to implement the function getClustersInDatacenter(datacenter) to return Array/VC:ClusterComputeResource with all the clusters inside the given datacenter. Here is some sample code for vRO scripting action to do so:

 

var result = new Array();
findComputeResourceInHostFolder(datacenter.hostFolder);
return result;

function findComputeResourceInHostFolder (hostFolder) {
  for each (var item in hostFolder.childEntity) {    if (item instanceof VcClusterComputeResource) {      result.push(item);    }  }  for each (var folder in hostFolder.childEntity) {    if (folder instanceof VcFolder) {      findComputeResourceInHostFolder(folder);    }  }
}

Re: after update to 7.2, findAllForType not working with filter

$
0
0

And another change I noticed which is now broken is the following:

 

var foundVMs = VcPlugin.allSdkConnections[theIndex].searchIndex.findAllByUuid(null, vmUuid, true);

 

if (foundVMs==null)

    throw("no matching vm found for requested UUID");

else

{

    System.log("Found VM: "+foundVMs[0].name);

    return foundVMs[0];

}

 

before I was able to ctach my error and chek for the text (or pass it along in an email) but not it generates an error saying :

 

InternalError: (vmodl.fault.SystemError) {

   faultCause = null,

   faultMessage = null,

   reason = Missing non-optional return value

} (Dynamic Script Module name : getVmFromUuid#12)

 

 

Maybe I will need to rework my code?? ( now that I have a bit more experience with vRO compared to when I first did this stuff, it all looks horrible)

Email of Logged in User

$
0
0

Hi,

I'm trying to get the email address of logged in user in vRO. From the community search I found the discusstion below.

Getting AD User attributes using plugin

I try to run the script but I got an error message. I try to modify it to see were I get stuck. I just run the script below with output name  actionResult and type Array/AD:User. Script did not failed but value was empty, so it tells me that this could not find any user. What would be the reason for this?

 

id = Server.getCurrentLdapUser().displayName;

actionResult = ActiveDirectory.searchExactMatch("User", id);

 

If I only run "id = Server.getCurrentLdapUser().displayName;" returns correct value. I also validate that I can get an attribute of an AD user if I select the AD user as an input.

 

Thanks,

Haluk

Re: Simple & Low Cost BackUp & Data Recovery ?

$
0
0

Hi Thanks for you reply,

 

Do you know of any simple easy to understand guides to set this up on a VCenter 5.5 on VM esxcli hosts that run version 5.1 - 5.5 ?

 

I saw this one here: Install and configure VMware vSphere Data Protection - TechRepublic

 

  1. Download the Virtual Appliance from your VMware customer portal. 

For step 1 what is the "Virtual Appliance" exactly that we must download from from the portal?  In my customer portal I see this is the correct appliance to download?

 

 

https://my.vmware.com/group/vmware/details?downloadGroup=VDP614&productId=614

 

VMware vSphere Data Protection

File size: 5.61 GB

File type: ova

 

Where is the data being backed up to?  On the same host?   Looking through this document here : http://www.vmware.com/content/dam/digitalmarketing/vmware/en/pdf/vsphere/vmware-vsphere-data-protection-overview.pdf

http://www.vmware.com/content/dam/digitalmarketing/vmware/en/pdf/vsphere/vmware-vsphere-data-protection-overview.pdf

 

WHich servers need to be rebooted to install VDP? Just the server running VCenter? What about the VMWare host themselves do they require a reboot?

Viewing all 246952 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>