Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 231085

VApp script to loop answer the VM questions WHILE powering on the Vapps ???????HELP

$
0
0

My first post here so forgive me if this is not right.

 

not a crazy scripting person but was looking into a way to help automate my department a little. We deal with a lot of classes for a lot of VM's that just get snap restored and powered back on then thats it. Right now everything is manual, So i created a script in powershell basically to go into VC server turn off a bunch of VApp's then go into our Netapp filers and snap restore the volume that has all the vm's in them then go back into the VC and turn back on the VApp's. Now is the problem!!! in doing this after a snap restore of the VOL and you go and turn back on the VApp's VMware sometimes asks question of the integrity of the VM like

 

So the script i need is to turn on the Vapp's while waitting for this question to come up and auto answer it  pretty much below is a copy of my script im using. just need some help tweeking it to work properly

 

###############################################################################

# #

###############################################################################

#

Connect-VIServer -Server xxx.xxx.xxx.xxx -Protocol https -User xxxxxxxxx -Password xxxxxxxx

#

Start-Sleep -s 30

#

Get-VApp CAPT_Pod0, CAPT_Pod1, CAPT_Pod2, CAPT_Pod3, CAPT_Pod4, CAPT_Pod5, CAPT_Pod6, CAPT_Pod7, CAPT_Pod8 | Stop-VApp -Confirm:$false

#

Start-Sleep -s 45

#

#

#

####################################################################

#  #

####################################################################

#

$password = ConvertTo-SecureString "xxxxxxxxxxxxxxxx" -AsPlainText -Force

#

$cred = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList "xxxxxxxxxxx",$password

#

Connect-NcController xxx.xxx.xxx.xxx -Credential $cred -Vserver vm_data1

#

Start-sleep -s 30

#

$snap = get-ncsnapshot capt_prod_ds | Where-Object {$_.name -like "*pristine_30Mar2015*"}

#

restore-ncsnapshotvolume capt_prod_ds $snap.name -confirm:$false

#

Start-Sleep -s 10

#

#

#

###############################################################################

# #

###############################################################################

#

#Connect-VIServer -Server xxx.xxx.xxx.xxx -Protocol https -User xxxxxxxxx -Password xxxxxxxxxxxxxxxx

#

Start-Sleep -s 30

#

Get-VApp CAPT_Pod0, CAPT_Pod1, CAPT_Pod2, CAPT_Pod3, CAPT_Pod4, CAPT_Pod5, CAPT_Pod6, CAPT_Pod7, CAPT_Pod8 | Start-VApp

#

Start-Sleep -s 45

#

Exit


Viewing all articles
Browse latest Browse all 231085

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>