VMware Cloud Community
Percy1
Contributor
Contributor
Jump to solution

How to identify the cluster name to run createresourcepool script?

I want to manage the Resource Pool in ESX 4.1.

And luckily I found a script from here, written by William Lam in 11/28/09.

Hello Lam, how are you?

I want to test you code but I don't know how to use it.

I mean, I have an ESX machine, only one, with a host name datastore1.vlab.iu.hio.no, which should not be called a cluster.

But if I want to run your script, I should offer a cluster name. So what is the cluster name here?

Thank you.

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
lamw
Community Manager
Community Manager
Jump to solution

Hello,

If you're referring to the createResourcePool.pl script, the documentation provides an example on how to use the vSphere SDK for Perl script.

./createResourcepool.pl --server reflex.primp-industries.com --username primp --cluster "R&D" --resourcepool rp6

You will need to provide the name of the vCenter cluster in which you want to create the resource pool, in the example I'm creating a resouce pool called "rp6" under cluster "R&D".

If you're just managing a standalone ESX(i) host which it sounds like you are, then you will need a few modification to the script to allow you to create a resource pool directly on ESX(i) host. Attached is a quick tweak to the existing script and all you need to do is connect directly to your host and specify the name of the resource pool you would like to create. It assumes that no existing resource pools exists and this will be attached to the main global "resourcePool" which is there by default but you don't see it.

Here's the syntax:

./rp.pl --server himalaya.primp-industries.com --username root --resourcepool myRP

View solution in original post

0 Kudos
5 Replies
lamw
Community Manager
Community Manager
Jump to solution

Hello,

If you're referring to the createResourcePool.pl script, the documentation provides an example on how to use the vSphere SDK for Perl script.

./createResourcepool.pl --server reflex.primp-industries.com --username primp --cluster "R&D" --resourcepool rp6

You will need to provide the name of the vCenter cluster in which you want to create the resource pool, in the example I'm creating a resouce pool called "rp6" under cluster "R&D".

If you're just managing a standalone ESX(i) host which it sounds like you are, then you will need a few modification to the script to allow you to create a resource pool directly on ESX(i) host. Attached is a quick tweak to the existing script and all you need to do is connect directly to your host and specify the name of the resource pool you would like to create. It assumes that no existing resource pools exists and this will be attached to the main global "resourcePool" which is there by default but you don't see it.

Here's the syntax:

./rp.pl --server himalaya.primp-industries.com --username root --resourcepool myRP
0 Kudos
bulletprooffool
Champion
Champion
Jump to solution

I'd consider using PowerCli if I were you - William's script is perfect for the job, but I personally find PowerCli a great deal easier than.pl.

get-help New-ResourcePool

NAME
    New-ResourcePool

SYNOPSIS
    Creates a new resource pool.


SYNTAX
    New-ResourcePool -Location <VIContainer> -Name <String> [-CpuExpandableReservation [<Boolean>]] [-CpuLimitMhz <Int64>] [-CpuReservationMhz <Int64
    >] [-CpuSharesLevel <SharesLevel>] [-MemExpandableReservation [<Boolean>]] [-MemLimitMB <Int64>] [-MemReservationMB <Int64>] [-MemSharesLevel <Sh
    aresLevel>] [-NumCpuShares <Int32>] [-NumMemShares <Int32>] [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>]

See:

http://www.vmware.com/support/developer/PowerCLI/PowerCLI41U1/html/New-ResourcePool.html

One day I will virtualise myself . . .
Percy1
Contributor
Contributor
Jump to solution

Thank you very much!

0 Kudos
Percy1
Contributor
Contributor
Jump to solution

Thanks!

0 Kudos
Percy1
Contributor
Contributor
Jump to solution

Thank you for your code.

But is there a way to create or add virtual machine by command?

For example, from vCLI, this command can help me to create a folder which can be treated as a virtual machine.

vifs --server ip --username root --password password --mkdir '[datastore1] vm1'

But it will be threw into the default resource pool Resources.

Can I throw it into another resource pool by command by vCLI or other API function?

Thank you.

0 Kudos