Workspace-Guru

new-appvolume

Oct 13th, 2018
4,433
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $App_server = "Seq-prod-01"                 ## Name of the Seqeuncer server on which we install the applications and create the layers
  2. $App_server_username = "DOMAIN\User"        ## Account with local Administrator rights on sequencer server
  3. $App_server_password = 'P@ssw0rd'           ## Password of the administrator account
  4. $Datastore = 'SSD01'                        ## Name of VMware datastore
  5. $Apppath = 'cloudvolumes/apps'              ## VMware application path
  6. $Templatepath = 'cloudvolumes/apps_templates' ## Template path in VMware
  7. $Template = 'template.vmdk'                 ## Name of the template vmdk
  8. $App_name = 'Firefox'                       ## Application name
  9.  
  10. ### Create new app volume wait on completion
  11. write-host "Create App Volume"
  12. Invoke-WebRequest -WebSession $Login -Method Post -Uri "http://$server/cv_api/appstacks?bg=1&name=$App_name&datastore=$datastore&path=$Apppath&template_path=$templatepath&template_name=$Template" | out-null
  13. DO {
  14.     write-host "Wait until App Volume is created..."
  15.     $pending_jobs = ((Invoke-WebRequest -WebSession $Login -Method Get -Uri "http://$server/cv_api/jobs/pending").content | ConvertFrom-Json)
  16.     Start-Sleep -s 2
  17. }UNTIL($pending_jobs.pending -eq "0")
  18. write-host "App Volume is created"
Advertisement
Add Comment
Please, Sign In to add comment