VMware Cloud Community
MariusRoma
Expert
Expert
Jump to solution

Creating a folder in a cluster

I apologize for the very basic question.

I have a datacenter whose nema is, let's say, "MyDatacenter" and a cluster inside the datacenter whose name in "MyCluster".

How can I create a folder whose nami ins "Folder1" in "MyCluster" so that I can see:

MyDatacenter

     MyCluster

          Folder1

          Folder2

               Subfolder2_1

          Folder3

Up to now I was unable to get the right syntax...

Regards

marius

0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

Afaik you can't create a yellow folder under a cluster.

But I might have misunderstood the question, perhaps include a screenshot of such a sample folder created in the Web Client?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

0 Kudos
3 Replies
LucD
Leadership
Leadership
Jump to solution

Afaik you can't create a yellow folder under a cluster.

But I might have misunderstood the question, perhaps include a screenshot of such a sample folder created in the Web Client?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
MariusRoma
Expert
Expert
Jump to solution

Many thanks for your answer.

What do you mean "Yellow folder"?

In mu unsuccessful tests I noticed that I was able to create yallow folders inside the Datacenter, but it's not what I want!!!

I simply need to create a blue folder inside the cluster.

I suspect I should use a different command, is it correct?

Which command should I use?

Regards

marius

0 Kudos
LucD
Leadership
Leadership
Jump to solution

The so-called yellow and blue folders are from pre-vSphere 6 days.

Now we have 4 types of folders that you can create (and they are all yellow-orange)

  1. Host and Cluster
  2. VM and Template
  3. Network
  4. Storage

To make it a bit more complicated, as long as you stay (in the tree structure) above a Datacenter, the folders will not be of a specific of these 4 types.

Folders can be created at a few specific locations, like under the vCenter, Datacenter and other folders

For example

New-Folder -Name Folder1 -Location (Get-Datacenter -Name DC1)

When you want to create a folder under a Datacenter, you have to pick one of the 4 types above.

Currently not yet supported via a cmdlet, but you can pick the (hidden) parent-folder, and thus determine the type of the new folder.

For example (this is using the vSphere API method)

$dc = Get-Datacenter -Name DC1

$hostFolder = Get-View -id $dc.ExtensionData.HostFolder

$hostFolder.CreateFolder('TestHostFolder')

$vmFolder = Get-View -id $dc.ExtensionData.VmFolder

$vmFolder.CreateFolder('TestVmFolder')

$netFolder = Get-View -id $dc.ExtensionData.NetworkFolder

$netFolder.CreateFolder('TestNetFolder')

$dsFolder = Get-View -id $dc.ExtensionData.DatastoreFolder

$dsFolder.CreateFolder('TestDSFolder')


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos