www.vmwareadmins.com

how many VMs can you put in a box?

  • Increase font size
  • Default font size
  • Decrease font size
Welcome to VMwareAdmins.com!

Add NFS Mount To Host Using vOrchestrator

E-mail Print PDF

So, in PowerCLI to add an NFS mount to a host, you would use the following code:

$myhost = Get-VMHost 
    New-Datastore -Nfs -VMHost $myhost -Name nas-staging -Path /nas-staging -NfsHost devnas5s1.dev.org

However, you would need PowerShell, PowerCLI and the permissions to perform the action. Not only that, but you would also need the knowledge of how to execute PowerShell code, and be able to determine what vCenter server the host your trying to work with is connected too. 

Let's automate this! So in vOrchestrator, get a new workflow going.

Add a scriptable task, I used the following code block:

var hostDatastoreSystemRef = VMHost.configManager.datastoreSystem;
var hostDatastoreSys = VcPlugin.convertToVimManagedObject(VMHost, hostDatastoreSystemRef);

var NasVolumeSpec = new VcHostNasVolumeSpec();
NasVolumeSpec.accessMode = "readWrite";
NasVolumeSpec.localPath = name;
NasVolumeSpec.remoteHost = nfsHost;
NasVolumeSpec.remotePath = path;

hostDatastoreSys.createNasDatastore(NasVolumeSpec);

Add the following inputs:

Set up your bindings:

Validate and add your end point:

And execute your workflow!

Done!

 

From here, you can add permissions to your operations or lower-level administration teams for execution.

Last Updated on Friday, 06 August 2010 07:20
 

Set Host Search Domain Using vOrchestrator

E-mail Print PDF

Super easy in PowerCLI, but let's automate it!

Create  your new workflow, add a scriptable task, drop the following code in the script tab:

var netwrkSystemRef = Host.configManager.networkSystem;
var netwrkSys = VcPlugin.convertToVimManagedObject(Host , netwrkSystemRef);

var dnsConfigSpec = netwrkSys.NetworkConfig.DnsConfig;

dnsConfigSpec.SearchDomain = newSearchDomains;

netwrkSys.updateDnsConfig(dnsConfigSpec);

Create the following inputs:

 

then click on the visual binding tab, and connect them together:

connect your blocks, validate, and run!

 

 

 
  • «
  •  Start 
  •  Prev 
  •  1 
  •  2 
  •  3 
  •  4 
  •  5 
  •  6 
  •  7 
  •  8 
  •  9 
  •  10 
  •  Next 
  •  End 
  • »


Page 1 of 22

Follow Me On...

Facebook linkedin twitter youtube

Polls

What Version of vSphere are you purchasing?