VMware Cloud Community
rbutter
Contributor
Contributor
Jump to solution

PowerCLI to register templates in vCenter

Got PowerCli 4.1.1 and can't seem to get a script to register my templates in vCenter 4.1.  Every script registers the .vmtx files as .vmx files in vCenter inventory.  Then they are unusable.  Any help would be appreciated!!

Reply
0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

That is possible, you can do something like this

Register-VMX -dsNames “datastore″ -template:$true


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

View solution in original post

Reply
0 Kudos
8 Replies
LucD
Leadership
Leadership
Jump to solution

Have a look at my Raiders of the Lost VMX post. With the Template switch it allows you to register templates.


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

rbutter
Contributor
Contributor
Jump to solution

Thanks LucD, I'll have a go at it in the morning.  I have all my templates on a single datastore.  This is a pretty involved script.  Is there a way to pair it down to register just templates and just from a single datastore.  I need to make it as simple as possible for my customer.

Thanks!

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

That is possible, you can do something like this

Register-VMX -dsNames “datastore″ -template:$true


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

Reply
0 Kudos
rbutter
Contributor
Contributor
Jump to solution

LucD, that worked like a charm!! Thanks!!! Is there a way to direct the registered templates into a specific blue folder?

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

The script currenly doesn't allow a target folder to register the VMs or Templates.

And the problem with a "blue" folder is that I can't use that as a parameter in the RegisterVM_Task.

I think you better use the Move-Template cmdlet, after the template is registered, to move it to a specific blue folder.


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

rbutter
Contributor
Contributor
Jump to solution

Thanks again Luc!! I am deploying VMs from templates using powercli 4.1.1. My VMs have multiple virtual NICs. How can I add the ability to my deployment script to change the network label/name for each of these NICs?

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

Did you try the Set-NetworkAdapter cmdlet ?

If you can explain me how the change has to be done (which portgroup to which portgroup on which NIC), I can provide you an example script.


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

Reply
0 Kudos
rbutter
Contributor
Contributor
Jump to solution

Luc,

Got it figured out. Thanks!!

Reply
0 Kudos