Horizon View automation part 2

As per part1, The view pool created using script which eases our operation. View admin would like to automate the view pool operations using powercli.

  1. To reduce no of desktops
  2. Disable provisoin and pools
  3. Enable provision and pools
  4. Update LC pool datastore
  5. Update Snapshot for LC pool
  6. To do Recompose with new snapshot

 

  1. To reduce no of desktops:

update-AutomaticLinkedClonePool -Pool_id “Pool1” -MinimumCount 1 -MaximumCount 1 -headroomCount 1

update-AutomaticLinkedClonePool -Pool_id “Pool2” -MinimumCount 1 -MaximumCount 1 -headroomCount 1

As per standard:

update-AutomaticLinkedClonePool -Pool_id “Pool1” -MinimumCount 2 -MaximumCount 5 -headroomCount 2

update-AutomaticLinkedClonePool -Pool_id “Pool2” -MinimumCount 2 -MaximumCount 5 -headroomCount 2

2. Disable provisoin and pools

update-AutomaticLinkedClonePool -Pool_id “Pool1” -Disabled 1 -IsProvisioningEnabled 0

update-AutomaticLinkedClonePool -Pool_id “Pool2” -Disabled 1 -IsProvisioningEnabled 0

3. Enable provision and pools

update-AutomaticLinkedClonePool -Pool_id “Pool1” -Disabled 0 -IsProvisioningEnabled 1

update-AutomaticLinkedClonePool -Pool_id “Pool2” -Disabled 0 -IsProvisioningEnabled 1

4. Update LC pool datastore

update-AutomaticLinkedClonePool -Pool_id “Pool1” -DatastoreSpecs aaa/host/Datastorename

update-AutomaticLinkedClonePool -Pool_id “Pool2” -aaa/host/Datastorename

5. Update Snapshot for LC pool

Update-AutomaticLinkedClonePool -pool_id “Pool1” -parentVMPath /vc/vm/BASE/vm -parentSnapshotPath /3360339A1 -ErrorAction “stop”

6. To do Recompose with new snapshot:

Update-AutomaticLinkedClonePool -pool_id “pool1” -parentVMPath /location of vm -parentSnapshotPath /602G9A1 -ErrorAction “stop”

Get-Desktopvm -pool_id pool1 | Send-LinkedCloneRecomposeĀ  -parentVMPath /vm/BASE/vm1 -parentSnapshotPath /vm1 -schedule ((get-date).addminutes(2)) -forceLogoff:$true -stopOnError:$true -ErrorAction “stop”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: