bridgegroup
Enthusiast
Enthusiast

Copy-DeployRule to change the image

Hello community,

I can not understand how can I change the image with the Copy-DeployRule command...

For example, using this command

Copy-DeployRule -DeployRule <current-deploy-rule> -ReplaceItem <new-cluster>

I can force ESXi hosts to join to new cluster.

But how can I change image?

Any advices?

Thanks a lot

0 Kudos
6 Replies
rachelsg
Enthusiast
Enthusiast

Hi

Welcome to communities.

It will give you details if any query please let us know.

http://pubs.vmware.com/vsphere-55/index.jsp?topic=%2Fcom.vmware.powercli.cmdletref.doc%2FCopy-Deploy...

0 Kudos
bridgegroup
Enthusiast
Enthusiast

Hello rachelsg,

I've seen this link. Thanks

I just can not understand what data should I define as esxi-image-profile?

Copy-DeployRule -DeployRule <current-deploy-rule> -ReplaceItem <esxi-image>

should I use esxi-images from https://hostupdate.vmware.com/software/VUM/PRODUCTION/main/vmw-depot-index.xml

or use local offline bundles?

My deploy rule

PowerCLI C:\Windows\system32> Get-DeployRule

Name        : Rule1

PatternList : {ipv4=192.168.251.10-192.168.251.250}

ItemList    : {ESXi-5.1.0-20121204001-standard, Cluster2, Profile1}

I can change Cluster but whe I try to do this

PowerCLI C:\Windows\system32> Copy-DeployRule -DeployRule "Rule1" -ReplaceItem ESXi-5.5.0-2001-standard

I get the following error:

Copy-DeployRule : 21.07.2014 17:19:44    Copy-DeployRule        Could not find VIObjectCore with name 'ESXi-5.5.0-2001-standard'.

+ Copy-DeployRule <<<<  -DeployRule "Rule1" -ReplaceItem ESXi-5.5.0-2001-standard

    + CategoryInfo          : ObjectNotFound: (ESXi-5.5.0-2001-standard:String) [Copy-DeployRule], VimException

    + FullyQualifiedErrorId : Core_ObnSelector_SelectObjectByNameCore_ObjectNotFound,VMware.DeployAutomation.Commands.CopyDeployRule

I know that I'm doing smth wrong.

Unfortunately I can not understand what exactly.

Thanks

0 Kudos
bridgegroup
Enthusiast
Enthusiast

Hello,

any ideas?

any help?

0 Kudos
admin
Immortal
Immortal

I'm having the same problem, have you found the solution since then ?

0 Kudos
bridgegroup
Enthusiast
Enthusiast

Здравствуйте.

Я отсутствую в офисе до 15 октября включительно.

Пожалуйста, контактируйте с моими коллегами:

Алексей Большаков - bolshakov@netcube.ru<mailto:bolshakov@netcube.ru>

Александр Рязанов - ryazanov@netcube.ru<mailto:ryazanov@netcube.ru>

Regards,

Evgeny Varnavsky

3 x CCIE #27127, CWDP

+7 (495) 642-8207 ext. 3152

www.netcube.ru<https://urldefense.proofpoint.com/v1/url?u=http://www.netcube.ru/&k=oIvRg1%2BdGAgOoM1...;

0 Kudos
dbuenoparedes
Enthusiast
Enthusiast

I know this is an old post, sorry for the late response but it's still valid.

The error you're getting is due to the <esxi-image> you're using for the new rule is a string "ESXi-5.5.0-2001-standard" but it needs to be an ImageProfile type (VIObjectCore). You'll need to store in a variable the new image profile you'd like to use, example:

$IP = Get-EsxImageProfile -Name "ESXi-5.5.0-2001-standard"

Copy-DeployRule -DeployRule "Rule1" -ReplaceItem $IP

That should do it.

0 Kudos