VMware Cloud Community
PowercliCommuni
Contributor
Contributor
Jump to solution

Test Failover

how to test faoliver using powercli?

privilege : test failover

description: Fault Tolerance failover by making the Secondary virtual machine the Primary virtual machine

Is this can be done in the same way like get-viprivilege,new-vipermission,new-virole?

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
RvdNieuwendijk
Leadership
Leadership
Jump to solution

MakePrimaryVM_Task is one of the methods for a virtual machine in the VMware vSphere API. If you do:

$vm = MyVM

$vm.ExtensionData | Get-Member


you will see all of the methods available for a virtual machine.

Click on the link above for the documentation.

Blog: https://rvdnieuwendijk.com/ | Twitter: @rvdnieuwendijk | Author of: https://www.packtpub.com/virtualization-and-cloud/learning-powercli-second-edition

View solution in original post

0 Kudos
11 Replies
Grzesiekk
Expert
Expert
Jump to solution

the id for this is

Virtualmachine.Interaction.Test failover

I make it in bold so you see it this time Smiley Wink heheheh

Yes, it can be don in that way like in your previous posts , by the way have you checked this document ?

http://pubs.vmware.com/vsphere-50/topic/com.vmware.ICbase/PDF/vsphere-esxi-vcenter-server-501-privil...

It has all the privs in it and the definitions.

--- @blog https://grzegorzkulikowski.info
PowercliCommuni
Contributor
Contributor
Jump to solution

Hmm..ya..last time i dint notice that.I have that document already.anyway thanks for tha link.is that can be done in any other way?

0 Kudos
PowercliCommuni
Contributor
Contributor
Jump to solution

Is there any other  direct commands for that?

0 Kudos
Grzesiekk
Expert
Expert
Jump to solution

not by default. i suppose instead of creating new roles you can edit existing ones, i dont know what do you mean with other approach.

For example you could make yourself a function that does all those steps for you. It would automate the whole process. Can you explain in bigger detail what kind of solution are you looking for?

--- @blog https://grzegorzkulikowski.info
0 Kudos
PowercliCommuni
Contributor
Contributor
Jump to solution

Actually,the commands like create vm ,change vm setting,test failover are the privileges of vm admin.We have direct commands for cretaing a vm and change setting and etc.so like that can we combile any powercli commands to perform this action?Or should we use like the previous solution?

0 Kudos
Grzesiekk
Expert
Expert
Jump to solution

Im sorry, i do not quite understand the question.

--- @blog https://grzegorzkulikowski.info
0 Kudos
PowercliCommuni
Contributor
Contributor
Jump to solution

direct commands are there to perform these actions.for example

delete vm : remove-vm -vm host1

Like that,Is there any powercli command or combining such command,can we do this?

0 Kudos
PowercliCommuni
Contributor
Contributor
Jump to solution

For all the vmware privileges, the privilege id is there.

to remove a vm, the powercli command is there and with the privilege id also,we can do that.

Likewise,is there anyother way to perform this action with anu such commands other than using privilege id?

0 Kudos
RvdNieuwendijk
Leadership
Leadership
Jump to solution

If I understand your question correctly then you want to failover a primary VM to the secondary VM. You can do something like:

$PrimaryVM = Get-VM -Name PrimaryVM
$SecondaryVM = Get-VM -Name SecondaryVM
$PrimaryVM.ExtensionData.MakePrimaryVM_Task($PrimaryVM.Id,$SecondaryVM.Id)

Blog: https://rvdnieuwendijk.com/ | Twitter: @rvdnieuwendijk | Author of: https://www.packtpub.com/virtualization-and-cloud/learning-powercli-second-edition
PowercliCommuni
Contributor
Contributor
Jump to solution

is makeprimary_task is one of the default property that can be used directly?

0 Kudos
RvdNieuwendijk
Leadership
Leadership
Jump to solution

MakePrimaryVM_Task is one of the methods for a virtual machine in the VMware vSphere API. If you do:

$vm = MyVM

$vm.ExtensionData | Get-Member


you will see all of the methods available for a virtual machine.

Click on the link above for the documentation.

Blog: https://rvdnieuwendijk.com/ | Twitter: @rvdnieuwendijk | Author of: https://www.packtpub.com/virtualization-and-cloud/learning-powercli-second-edition
0 Kudos