cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2711
Views
0
Helpful
0
Comments
Orf Gelbrich
Cisco Employee
Cisco Employee
Task Name VM Details
Description  
Prerequisites
  1. Tested on 5.3
Category Workflow
Components vSphere 5.x
User Inputs  

Instructions for Regular Workflow Use:

  1. Download the attached .ZIP file below to your computer. *Remember the location of the saved file on your computer.
  2. Unzip the file on your computer. Should end up with a .WFD file.
  3. Log in to UCS Director as a user that has "system-admin" privileges.
  4. Navigate to "Policies-->Orchestration" and click on "Import".
  5. Click "Browse" and navigate to the location on your computer where the .WFD file resides. Choose the .WFD file and click "Open".
  6. Click "Upload" and then "OK" once the file upload is completed. Then click "Next".
  7. Click the "Select" button next to "Import Workflows". Click the "Check All" button to check all checkboxes and then the "Select" button.
  8. Click "Submit".
  9. A new folder should appear in "Policies-->Orchestration" that contains the imported workflow. You will now need to update the included tasks with information about the specific environment.

 

This example uses only DOS commands.

To see a similar workflow based on a VBS script go to UCSD Workflow-Windows VM Disk Create (Partition, Format and Assign Drive Letter) (VIX to VBS)

 

 

 

The workflow:

Screen Shot 2015-06-18 at 12.23.32 PM.png

Screen Shot 2015-06-18 at 12.23.47 PM.png

Screen Shot 2015-06-18 at 12.23.56 PM.png

 

 

 

The workflow execution:

 

Screen Shot 2015-06-18 at 12.14.35 PM.png

 

The workflow  results of the execution:

 

Screen Shot 2015-06-18 at 11.58.49 AM.png

Step 2

     Obtain the details on the VM (context or selected VM)

     Reason:  Looking for the data store the VM is on

 

Step 3

     The VM may have more then one datas tore.  Select the first one.

 

Step 4

     Generate the diskpart file to get the current disk lay out of the system

     C:\\Windows\\system32\\cmd.exe "/c echo list disk > c:\\f1.txt"

 

Step 5

     Execute the diskpart script and place results into a file

     C:\\Windows\\system32\\cmd.exe "/c diskpart /s  c:\\f1.txt > c:\\f2.txt"

 

Step 6

     Add a new disk to the VM with the custom LOV (list of values) provided of the size of the disk

     and the data store obtained in a previous step.

 

Step 7

     Execute dispart again to get new disk layout of the system

     C:\\Windows\\system32\\cmd.exe "/c diskpart /s  c:\\f1.txt > c:\\f3.txt"

 

Step 8

     Determine the differences between the original disk layout and the new disk layout.

     C:\\Windows\\system32\\cmd.exe "/c FC  c:\\f2.txt c:\\f3.txt > c:\\f4.txt"

 

Step 9

     Find the line with the new disk

     C:\\Windows\\system32\\cmd.exe "/c findstr /L Disk c:\\f4.txt > c:\\f5.txt"

 

Step 10

     Find just the disk name (disk 2)

     C:\\Windows\\system32\\cmd.exe "/c set /P  a= < c:\\f5.txt" &&

     C:\\Windows\\system32\\cmd.exe "/c echo select %a:~2,10%  > c:\\f6.txt"

 

Step 11

     Create a diskpart file with the new disk name and the Drive letter as user input.

     C:\\\\Windows\\\\system32\\\\cmd.exe "/c echo attributes disk clear readonly >> c:\\\\f6.txt" &&

     C:\\\\Windows\\\\system32\\\\cmd.exe "/c echo convert mbr >> c:\\\\f6.txt" &&

     C:\\\\Windows\\\\system32\\\\cmd.exe "/c echo create partition primary >> c:\\\\f6.txt" &&

     C:\\\\Windows\\\\system32\\\\cmd.exe "/c echo format quick fs=ntfs label="DataDisk" >> c:\\\\f6.txt" &&

     C:\\\\Windows\\\\system32\\\\cmd.exe "/c echo assign letter=${Drive_Letter} >> c:\\\\f6.txt"

 

Step 12

     execute diskpart to partition the disk and  format and mount the drive with new drive letter

     C:\\Windows\\system32\\cmd.exe "/c diskpart /s  c:\\f6.txt > c:\\f7.txt"

 

Step 13

     Collect inventory to make sure the disk is in the GUI in UCSD.

 

Step 14

     This could be added to clean up the helper files f1.txt - f7.txt in c:\

     I left them there for illustration.

 

 

Note:

 

     If VIX has a UCSD variable all \\ turn into \\\\

 

     The following 3 symbols can be passed to a Windows echo command ONLY when on the FIRST line of the VIX script task:  & >  <

     In all cases the symbol needs to be passed with \^ in front.

     The \ being the VIX escape character and the ^ being the DOS escape character.

 

 

 

 

 

The Run Log:

Service Request ID: 5173

Workflow Inputs:

- USER_ID

- Password_1

- diskType

- Disk_Size

- VMwareAccount

- Drive_Letter

 

 

Jun 18, 2015 16:45:16 UTC Request submitted

Jun 18, 2015 16:45:17 UTC Executing workflow item number 1

Jun 18, 2015 16:45:17 UTC Completed workflow item number 1, with status Completed

Jun 18, 2015 16:45:23 UTC Executing workflow item number 2

Jun 18, 2015 16:45:23 UTC Trigger context executeWorkFlowStep called

Jun 18, 2015 16:45:23 UTC Executing custom action Add Windows VM DISK (custom_getVMSummary)

Jun 18, 2015 16:45:23 UTC Executing custom action Add Windows VM DISK (custom_getVMSummary) for VM 1809 (PRD-Win1-01)

Jun 18, 2015 16:45:23 UTC Executing custom script for getVMSummary

Jun 18, 2015 16:45:26 UTC vmId = 1809

Jun 18, 2015 16:45:26 UTC Overview_VM_ID = 1809

Jun 18, 2015 16:45:26 UTC Overview_Instance_Name = PRD-Win1-01

Jun 18, 2015 16:45:26 UTC Overview_Status = ON (poweredOn)

Jun 18, 2015 16:45:26 UTC Overview_IP_Address = 172.17.32.106

Jun 18, 2015 16:45:26 UTC Overview_Hostname = PRD-Win1-01

Jun 18, 2015 16:45:26 UTC Overview_Image_ID = PRD-Win1-01

Jun 18, 2015 16:45:26 UTC Overview_Cloud_Name = Dallas

Jun 18, 2015 16:45:26 UTC Overview_Cloud_Type = VMWare

Jun 18, 2015 16:45:26 UTC Ownership_Group = Dallas_ACME_User_Group

Jun 18, 2015 16:45:26 UTC Ownership_vDC = VDC-Prod

Jun 18, 2015 16:45:26 UTC Ownership_Category = Generic VM

Jun 18, 2015 16:45:26 UTC Ownership_Service_Request_ID = 5035

Jun 18, 2015 16:45:26 UTC Ownership_Label = Win1

Jun 18, 2015 16:45:26 UTC Ownership_Provisioned_Time = Jun 10, 2015 20:02:05 UTC

Jun 18, 2015 16:45:26 UTC Ownership_Scheduled_Termination_Time =

Jun 18, 2015 16:45:26 UTC Overview_Host_Node = 172.17.32.113

Jun 18, 2015 16:45:26 UTC Network_Port_Group = VM Network

Jun 18, 2015 16:45:26 UTC Network_VLAN_ID = 0

Jun 18, 2015 16:45:26 UTC Network_No_of_vNics = 1

Jun 18, 2015 16:45:26 UTC Network_vNic_Mac_Address = 00:50:56:94:69:88

Jun 18, 2015 16:45:26 UTC Network_vNic_Device_Config_Id = 4000

Jun 18, 2015 16:45:26 UTC Overview_Boot_Time = Jun 10, 2015 20:09:43 UTC

Jun 18, 2015 16:45:26 UTC Overview_Config_Name = PRD-Win1-01

Jun 18, 2015 16:45:26 UTC Overview_VM_Version = vmx-08

Jun 18, 2015 16:45:26 UTC Resources_Resource_Pool = DallasProd1

Jun 18, 2015 16:45:26 UTC Resources_Num_Virtual_CPUs = 1

Jun 18, 2015 16:45:26 UTC Resources_CPU_Reserved_MHz = 0.0

Jun 18, 2015 16:45:26 UTC Resources_CPU_Limit_MHz = -1.0

Jun 18, 2015 16:45:26 UTC Resources_CPU_Overhead_Limit_MHz = 0.0

Jun 18, 2015 16:45:26 UTC Resources_CPU_Shares = 1000

Jun 18, 2015 16:45:26 UTC Resources_Memory_MB = 1024

Jun 18, 2015 16:45:26 UTC Resources_Memory_Reserved_MB = 0.0

Jun 18, 2015 16:45:26 UTC Resources_Memory_Limit_MB = 0.0

Jun 18, 2015 16:45:26 UTC Resources_Memory_Overhead_Limit_MB = 130.0

Jun 18, 2015 16:45:26 UTC Resources_Memory_Shares = 40960

Jun 18, 2015 16:45:26 UTC Storage_Total_Provisioned_GB = 56.05

Jun 18, 2015 16:45:26 UTC Storage_Committed_GB = 56.05

Jun 18, 2015 16:45:26 UTC Storage_Uncommitted_GB = 0.0

Jun 18, 2015 16:45:26 UTC Storage_Non_shared_GB = 56.05

Jun 18, 2015 16:45:26 UTC Storage_Data_Store_Names = UCSD_DS_SR_3724_San5

Jun 18, 2015 16:45:26 UTC Storage_VM_Path = [UCSD_DS_SR_3724_San5] PRD-Win1-01/PRD-Win1-01.vmx

Jun 18, 2015 16:45:26 UTC Guest_Information_Guest_OS = Microsoft Windows Server 2008 R2 (64-bit)

Jun 18, 2015 16:45:26 UTC Guest_Information_Guest_State = running

Jun 18, 2015 16:45:26 UTC Guest_Information_Tools_Status = guestToolsRunning

Jun 18, 2015 16:45:26 UTC Guest_Information_Tools_Version = 8384

Jun 18, 2015 16:45:26 UTC Options_Default_PowerOff_Type = soft

Jun 18, 2015 16:45:26 UTC Processing output: Overview_VM_ID

Jun 18, 2015 16:45:27 UTC Processing output: Overview_Instance_Name

Jun 18, 2015 16:45:28 UTC Processing output: Overview_Status

Jun 18, 2015 16:45:29 UTC Processing output: Overview_IP_Address

Jun 18, 2015 16:45:30 UTC Processing output: Overview_Hostname

Jun 18, 2015 16:45:31 UTC Processing output: Overview_Image_ID

Jun 18, 2015 16:45:32 UTC Processing output: Overview_Cloud_Name

Jun 18, 2015 16:45:34 UTC Processing output: Overview_Cloud_Type

Jun 18, 2015 16:45:35 UTC Processing output: Ownership_Group

Jun 18, 2015 16:45:36 UTC Processing output: Ownership_vDC

Jun 18, 2015 16:45:37 UTC Processing output: Ownership_Category

Jun 18, 2015 16:45:38 UTC Processing output: Ownership_Service_Request_ID

Jun 18, 2015 16:45:40 UTC Processing output: Ownership_Label

Jun 18, 2015 16:45:41 UTC Processing output: Ownership_Provisioned_Time

Jun 18, 2015 16:45:42 UTC Processing output: Ownership_Scheduled_Termination_Time

Jun 18, 2015 16:45:43 UTC Processing output: Overview_Host_Node

Jun 18, 2015 16:45:44 UTC Processing output: Network_Port_Group

Jun 18, 2015 16:45:45 UTC Processing output: Network_VLAN_ID

Jun 18, 2015 16:45:46 UTC Processing output: Network_No_of_vNics

Jun 18, 2015 16:45:47 UTC Processing output: Network_vNic_Mac_Address

Jun 18, 2015 16:45:48 UTC Processing output: Network_vNic_Device_Config_Id

Jun 18, 2015 16:45:49 UTC Processing output: Overview_Boot_Time

Jun 18, 2015 16:45:50 UTC Processing output: Overview_Config_Name

Jun 18, 2015 16:45:51 UTC Processing output: Overview_VM_Version

Jun 18, 2015 16:45:52 UTC Processing output: Resources_Resource_Pool

Jun 18, 2015 16:45:54 UTC Processing output: Resources_Num_Virtual_CPUs

Jun 18, 2015 16:45:55 UTC Processing output: Resources_CPU_Reserved_MHz

Jun 18, 2015 16:45:56 UTC Processing output: Resources_CPU_Limit_MHz

Jun 18, 2015 16:45:57 UTC Processing output: Resources_CPU_Overhead_Limit_MHz

Jun 18, 2015 16:45:58 UTC Processing output: Resources_CPU_Shares

Jun 18, 2015 16:45:59 UTC Processing output: Resources_Memory_MB

Jun 18, 2015 16:46:01 UTC Processing output: Resources_Memory_Reserved_MB

Jun 18, 2015 16:46:02 UTC Processing output: Resources_Memory_Limit_MB

Jun 18, 2015 16:46:03 UTC Processing output: Resources_Memory_Overhead_Limit_MB

Jun 18, 2015 16:46:04 UTC Processing output: Resources_Memory_Shares

Jun 18, 2015 16:46:05 UTC Processing output: Storage_Total_Provisioned_GB

Jun 18, 2015 16:46:06 UTC Processing output: Storage_Committed_GB

Jun 18, 2015 16:46:08 UTC Processing output: Storage_Uncommitted_GB

Jun 18, 2015 16:46:09 UTC Processing output: Storage_Non_shared_GB

Jun 18, 2015 16:46:10 UTC Processing output: Storage_Data_Store_Names

Jun 18, 2015 16:46:11 UTC Processing output: Storage_VM_Path

Jun 18, 2015 16:46:12 UTC Processing output: Guest_Information_Guest_OS

Jun 18, 2015 16:46:13 UTC Processing output: Guest_Information_Guest_State

Jun 18, 2015 16:46:14 UTC Processing output: Guest_Information_Tools_Status

Jun 18, 2015 16:46:15 UTC Processing output: Guest_Information_Tools_Version

Jun 18, 2015 16:46:16 UTC Processing output: Options_Default_PowerOff_Type

Jun 18, 2015 16:46:17 UTC Task #1 (Add Windows VM DISK (custom_getVMSummary)) completed successfully in 53 seconds

Jun 18, 2015 16:46:17 UTC Input/Output values for Task #1 (Add Windows VM DISK (custom_getVMSummary)):

Jun 18, 2015 16:46:17 UTC [Template Input:VM_Id = ${VM_ID}]

Jun 18, 2015 16:46:17 UTC [Resolved Template Input: VM_Id = 1809]

Jun 18, 2015 16:46:17 UTC [Local Input: VM_Id = 1809]

Jun 18, 2015 16:46:17 UTC [Output: Overview_VM_ID = 1809]

Jun 18, 2015 16:46:17 UTC [Output: Overview_Instance_Name = PRD-Win1-01]

Jun 18, 2015 16:46:17 UTC [Output: Overview_Status = ON (poweredOn)]

Jun 18, 2015 16:46:17 UTC [Output: Overview_IP_Address = 172.17.32.106]

Jun 18, 2015 16:46:17 UTC [Output: Overview_Hostname = PRD-Win1-01]

Jun 18, 2015 16:46:17 UTC [Output: Overview_Image_ID = PRD-Win1-01]

Jun 18, 2015 16:46:17 UTC [Output: Overview_Cloud_Name = Dallas]

Jun 18, 2015 16:46:17 UTC [Output: Overview_Cloud_Type = VMWare]

Jun 18, 2015 16:46:17 UTC [Output: Ownership_Group = Dallas_ACME_User_Group]

Jun 18, 2015 16:46:17 UTC [Output: Ownership_vDC = VDC-Prod]

Jun 18, 2015 16:46:17 UTC [Output: Ownership_Category = Generic VM]

Jun 18, 2015 16:46:17 UTC [Output: Ownership_Service_Request_ID = 5035]

Jun 18, 2015 16:46:17 UTC [Output: Ownership_Label = Win1]

Jun 18, 2015 16:46:17 UTC [Output: Ownership_Provisioned_Time = Jun 10, 2015 20:02:05 UTC]

Jun 18, 2015 16:46:17 UTC [Output: Ownership_Scheduled_Termination_Time = ]

Jun 18, 2015 16:46:17 UTC [Output: Overview_Host_Node = 172.17.32.113]

Jun 18, 2015 16:46:17 UTC [Output: Network_Port_Group = VM Network]

Jun 18, 2015 16:46:17 UTC [Output: Network_VLAN_ID = 0]

Jun 18, 2015 16:46:17 UTC [Output: Network_No_of_vNics = 1]

Jun 18, 2015 16:46:17 UTC [Output: Network_vNic_Mac_Address = 00:50:56:94:69:88]

Jun 18, 2015 16:46:17 UTC [Output: Network_vNic_Device_Config_Id = 4000]

Jun 18, 2015 16:46:17 UTC [Output: Overview_Boot_Time = Jun 10, 2015 20:09:43 UTC]

Jun 18, 2015 16:46:17 UTC [Output: Overview_Config_Name = PRD-Win1-01]

Jun 18, 2015 16:46:17 UTC [Output: Overview_VM_Version = vmx-08]

Jun 18, 2015 16:46:17 UTC [Output: Resources_Resource_Pool = DallasProd1]

Jun 18, 2015 16:46:17 UTC [Output: Resources_Num_Virtual_CPUs = 1]

Jun 18, 2015 16:46:17 UTC [Output: Resources_CPU_Reserved_MHz = 0.0]

Jun 18, 2015 16:46:17 UTC [Output: Resources_CPU_Limit_MHz = -1.0]

Jun 18, 2015 16:46:17 UTC [Output: Resources_CPU_Overhead_Limit_MHz = 0.0]

Jun 18, 2015 16:46:17 UTC [Output: Resources_CPU_Shares = 1000]

Jun 18, 2015 16:46:17 UTC [Output: Resources_Memory_MB = 1024]

Jun 18, 2015 16:46:17 UTC [Output: Resources_Memory_Reserved_MB = 0.0]

Jun 18, 2015 16:46:17 UTC [Output: Resources_Memory_Limit_MB = 0.0]

Jun 18, 2015 16:46:17 UTC [Output: Resources_Memory_Overhead_Limit_MB = 130.0]

Jun 18, 2015 16:46:17 UTC [Output: Resources_Memory_Shares = 40960]

Jun 18, 2015 16:46:17 UTC [Output: Storage_Total_Provisioned_GB = 56.05]

Jun 18, 2015 16:46:17 UTC [Output: Storage_Committed_GB = 56.05]

Jun 18, 2015 16:46:17 UTC [Output: Storage_Uncommitted_GB = 0.0]

Jun 18, 2015 16:46:17 UTC [Output: Storage_Non_shared_GB = 56.05]

Jun 18, 2015 16:46:17 UTC [Output: Storage_Data_Store_Names = UCSD_DS_SR_3724_San5]

Jun 18, 2015 16:46:17 UTC [Output: Storage_VM_Path = [UCSD_DS_SR_3724_San5] PRD-Win1-01/PRD-Win1-01.vmx]

Jun 18, 2015 16:46:17 UTC [Output: Guest_Information_Guest_OS = Microsoft Windows Server 2008 R2 (64-bit)]

Jun 18, 2015 16:46:17 UTC [Output: Guest_Information_Guest_State = running]

Jun 18, 2015 16:46:17 UTC [Output: Guest_Information_Tools_Status = guestToolsRunning]

Jun 18, 2015 16:46:17 UTC [Output: Guest_Information_Tools_Version = 8384]

Jun 18, 2015 16:46:17 UTC [Output: Options_Default_PowerOff_Type = soft]

Jun 18, 2015 16:46:17 UTC Completed workflow item number 2, with status Completed

Jun 18, 2015 16:46:22 UTC Executing workflow item number 3

Jun 18, 2015 16:46:22 UTC Trigger context executeWorkFlowStep called

Jun 18, 2015 16:46:22 UTC Executing custom action Add Windows VM DISK (custom_ChopDatastoreName)

Jun 18, 2015 16:46:22 UTC Executing custom action Add Windows VM DISK (custom_ChopDatastoreName) for VM 1809 (PRD-Win1-01)

Jun 18, 2015 16:46:22 UTC Executing custom script for ChopDatastoreName

Jun 18, 2015 16:46:27 UTC Input...............: UCSD_DS_SR_3724_San5

Jun 18, 2015 16:46:27 UTC Section 0...............: UCSD_DS_SR_3724_San5

Jun 18, 2015 16:46:27 UTC Section 1...............: undefined

Jun 18, 2015 16:46:27 UTC Section 2...............: undefined

Jun 18, 2015 16:46:27 UTC Section 3...............: undefined

Jun 18, 2015 16:46:27 UTC Section 4...............: undefined

Jun 18, 2015 16:46:27 UTC Section 5...............: undefined

Jun 18, 2015 16:46:27 UTC Section 6...............: undefined

Jun 18, 2015 16:46:27 UTC Section 7...............: undefined

Jun 18, 2015 16:46:27 UTC Scirpt exited normally

Jun 18, 2015 16:46:27 UTC Processing output: output

Jun 18, 2015 16:46:28 UTC Task #2 (Add Windows VM DISK (custom_ChopDatastoreName)) completed successfully in 6 seconds

Jun 18, 2015 16:46:28 UTC Input/Output values for Task #2 (Add Windows VM DISK (custom_ChopDatastoreName)):

Jun 18, 2015 16:46:28 UTC [Mapped Input: input = UCSD_DS_SR_3724_San5]

Jun 18, 2015 16:46:28 UTC [Output: output = UCSD_DS_SR_3724_San5]

Jun 18, 2015 16:46:28 UTC Completed workflow item number 3, with status Completed

Jun 18, 2015 16:46:31 UTC Executing workflow item number 4

Jun 18, 2015 16:46:31 UTC Trigger context executeWorkFlowStep called

Jun 18, 2015 16:46:31 UTC Executing custom action Add Windows VM DISK (Execute VIX Script)

Jun 18, 2015 16:46:31 UTC Executing custom action Add Windows VM DISK (Execute VIX Script) for VM 1809 (PRD-Win1-01)

Jun 18, 2015 16:46:37 UTC [VIXActionHandler] - account details VMName :PRD-Win1-01 , Host :172.17.32.113 , OS Type :microsoft windows server 2008 r2 (64-bit) , ExitCode

Jun 18, 2015 16:46:40 UTC Task #3 (Add Windows VM DISK (Execute VIX Script)) completed successfully in 8 seconds

Jun 18, 2015 16:46:40 UTC Input/Output values for Task #3 (Add Windows VM DISK (Execute VIX Script)):

Jun 18, 2015 16:46:40 UTC [Mapped Input: Select VM = 1809]

Jun 18, 2015 16:46:40 UTC [Local Input: Credential Type = Login]

Jun 18, 2015 16:46:40 UTC [Mapped Input: Login = administrator]

Jun 18, 2015 16:46:40 UTC [Mapped Input: Password = **masked-value**]

Jun 18, 2015 16:46:40 UTC [Local Input: Script = C:\\Windows\\system32\\cmd.exe '/c echo list disk > c:\\f1.txt']

Jun 18, 2015 16:46:40 UTC [Local Input: Undo Script = ]

Jun 18, 2015 16:46:40 UTC [Output: EXIT_STATUS_CODE = 0]

Jun 18, 2015 16:46:40 UTC [Output: ERROR_STATUS_MESSAGE = ]

Jun 18, 2015 16:46:40 UTC Completed workflow item number 4, with status Completed

Jun 18, 2015 16:46:43 UTC Executing workflow item number 5

Jun 18, 2015 16:46:43 UTC Trigger context executeWorkFlowStep called

Jun 18, 2015 16:46:44 UTC Executing custom action Add Windows VM DISK (Execute VIX Script)

Jun 18, 2015 16:46:44 UTC Executing custom action Add Windows VM DISK (Execute VIX Script) for VM 1809 (PRD-Win1-01)

Jun 18, 2015 16:46:51 UTC [VIXActionHandler] - account details VMName :PRD-Win1-01 , Host :172.17.32.113 , OS Type :microsoft windows server 2008 r2 (64-bit) , ExitCode

Jun 18, 2015 16:46:54 UTC Task #4 (Add Windows VM DISK (Execute VIX Script)) completed successfully in 10 seconds

Jun 18, 2015 16:46:54 UTC Input/Output values for Task #4 (Add Windows VM DISK (Execute VIX Script)):

Jun 18, 2015 16:46:54 UTC [Mapped Input: Select VM = 1809]

Jun 18, 2015 16:46:54 UTC [Local Input: Credential Type = Login]

Jun 18, 2015 16:46:54 UTC [Mapped Input: Login = administrator]

Jun 18, 2015 16:46:54 UTC [Mapped Input: Password = **masked-value**]

Jun 18, 2015 16:46:54 UTC [Local Input: Script = C:\\Windows\\system32\\cmd.exe '/c diskpart /s c:\\f1.txt > c:\\f2.txt']

Jun 18, 2015 16:46:54 UTC [Local Input: Undo Script = ]

Jun 18, 2015 16:46:54 UTC [Output: EXIT_STATUS_CODE = 0]

Jun 18, 2015 16:46:54 UTC [Output: ERROR_STATUS_MESSAGE = ]

Jun 18, 2015 16:46:54 UTC Completed workflow item number 5, with status Completed

Jun 18, 2015 16:46:59 UTC Executing workflow item number 6

Jun 18, 2015 16:46:59 UTC Trigger context executeWorkFlowStep called

Jun 18, 2015 16:46:59 UTC Executing custom action Add Windows VM DISK (Create VM Disk)

Jun 18, 2015 16:46:59 UTC Executing custom action Add Windows VM DISK (Create VM Disk) for VM 1809 (PRD-Win1-01)

Jun 18, 2015 16:47:04 UTC Executing create disk action on VM 1809 as part of custom action Add Windows VM DISK, (datastore=UCSD_DS_SR_3724_San5, New Disk Size(GB)=5)

Jun 18, 2015 16:47:04 UTC Waiting for action to complete

Jun 18, 2015 16:47:34 UTC Action Complete

Jun 18, 2015 16:47:34 UTC Task #5 (Add Windows VM DISK (Create VM Disk)) completed successfully in 34 seconds

Jun 18, 2015 16:47:34 UTC Input/Output values for Task #5 (Add Windows VM DISK (Create VM Disk)):

Jun 18, 2015 16:47:34 UTC [Mapped Input: Select VM = 1809]

Jun 18, 2015 16:47:34 UTC [Mapped Input: Disk Size (GB) = 5]

Jun 18, 2015 16:47:34 UTC [Mapped Input: Select Disk Type = 1]

Jun 18, 2015 16:47:34 UTC [Mapped Input: Select Datastore = UCSD_DS_SR_3724_San5]

Jun 18, 2015 16:47:34 UTC [Local Input: Thin Provisioning = false]

Jun 18, 2015 16:47:34 UTC Completed workflow item number 6, with status Completed

Jun 18, 2015 16:47:36 UTC Executing workflow item number 7

Jun 18, 2015 16:47:36 UTC Trigger context executeWorkFlowStep called

Jun 18, 2015 16:47:36 UTC Executing custom action Add Windows VM DISK (Execute VIX Script)

Jun 18, 2015 16:47:36 UTC Executing custom action Add Windows VM DISK (Execute VIX Script) for VM 1809 (PRD-Win1-01)

Jun 18, 2015 16:47:43 UTC [VIXActionHandler] - account details VMName :PRD-Win1-01 , Host :172.17.32.113 , OS Type :microsoft windows server 2008 r2 (64-bit) , ExitCode

Jun 18, 2015 16:47:46 UTC Task #6 (Add Windows VM DISK (Execute VIX Script)) completed successfully in 9 seconds

Jun 18, 2015 16:47:46 UTC Input/Output values for Task #6 (Add Windows VM DISK (Execute VIX Script)):

Jun 18, 2015 16:47:46 UTC [Mapped Input: Select VM = 1809]

Jun 18, 2015 16:47:46 UTC [Local Input: Credential Type = Login]

Jun 18, 2015 16:47:46 UTC [Mapped Input: Login = administrator]

Jun 18, 2015 16:47:46 UTC [Mapped Input: Password = **masked-value**]

Jun 18, 2015 16:47:46 UTC [Local Input: Script = C:\\Windows\\system32\\cmd.exe '/c diskpart /s c:\\f1.txt > c:\\f3.txt']

Jun 18, 2015 16:47:46 UTC [Local Input: Undo Script = ]

Jun 18, 2015 16:47:46 UTC [Output: EXIT_STATUS_CODE = 0]

Jun 18, 2015 16:47:46 UTC [Output: ERROR_STATUS_MESSAGE = ]

Jun 18, 2015 16:47:46 UTC Completed workflow item number 7, with status Completed

Jun 18, 2015 16:47:49 UTC Executing workflow item number 8

Jun 18, 2015 16:47:49 UTC Trigger context executeWorkFlowStep called

Jun 18, 2015 16:47:49 UTC Executing custom action Add Windows VM DISK (Execute VIX Script)

Jun 18, 2015 16:47:49 UTC Executing custom action Add Windows VM DISK (Execute VIX Script) for VM 1809 (PRD-Win1-01)

Jun 18, 2015 16:47:55 UTC [VIXActionHandler] - account details VMName :PRD-Win1-01 , Host :172.17.32.113 , OS Type :microsoft windows server 2008 r2 (64-bit) , ExitCode :1

Jun 18, 2015 16:47:58 UTC Task #7 (Add Windows VM DISK (Execute VIX Script)) completed successfully in 8 seconds

Jun 18, 2015 16:47:58 UTC Input/Output values for Task #7 (Add Windows VM DISK (Execute VIX Script)):

Jun 18, 2015 16:47:58 UTC [Mapped Input: Select VM = 1809]

Jun 18, 2015 16:47:58 UTC [Local Input: Credential Type = Login]

Jun 18, 2015 16:47:58 UTC [Mapped Input: Login = administrator]

Jun 18, 2015 16:47:58 UTC [Mapped Input: Password = **masked-value**]

Jun 18, 2015 16:47:58 UTC [Local Input: Script = C:\\Windows\\system32\\cmd.exe '/c FC c:\\f2.txt c:\\f3.txt > c:\\f4.txt']

Jun 18, 2015 16:47:58 UTC [Local Input: Undo Script = ]

Jun 18, 2015 16:47:58 UTC [Output: EXIT_STATUS_CODE = 1]

Jun 18, 2015 16:47:58 UTC [Output: ERROR_STATUS_MESSAGE = ]

Jun 18, 2015 16:47:58 UTC Completed workflow item number 8, with status Completed

Jun 18, 2015 16:47:58 UTC Executing workflow item number 9

Jun 18, 2015 16:47:58 UTC Trigger context executeWorkFlowStep called

Jun 18, 2015 16:47:58 UTC Executing custom action Add Windows VM DISK (Execute VIX Script)

Jun 18, 2015 16:47:58 UTC Executing custom action Add Windows VM DISK (Execute VIX Script) for VM 1809 (PRD-Win1-01)

Jun 18, 2015 16:48:07 UTC [VIXActionHandler] - account details VMName :PRD-Win1-01 , Host :172.17.32.113 , OS Type :microsoft windows server 2008 r2 (64-bit) , ExitCode

Jun 18, 2015 16:48:10 UTC Task #8 (Add Windows VM DISK (Execute VIX Script)) completed successfully in 11 seconds

Jun 18, 2015 16:48:10 UTC Input/Output values for Task #8 (Add Windows VM DISK (Execute VIX Script)):

Jun 18, 2015 16:48:10 UTC [Mapped Input: Select VM = 1809]

Jun 18, 2015 16:48:10 UTC [Local Input: Credential Type = Login]

Jun 18, 2015 16:48:10 UTC [Mapped Input: Login = administrator]

Jun 18, 2015 16:48:10 UTC [Mapped Input: Password = **masked-value**]

Jun 18, 2015 16:48:10 UTC [Local Input: Script = C:\\Windows\\system32\\cmd.exe '/c findstr /L Disk c:\\f4.txt > c:\\f5.txt']

Jun 18, 2015 16:48:10 UTC [Local Input: Undo Script = ]

Jun 18, 2015 16:48:10 UTC [Output: EXIT_STATUS_CODE = 0]

Jun 18, 2015 16:48:10 UTC [Output: ERROR_STATUS_MESSAGE = ]

Jun 18, 2015 16:48:10 UTC Completed workflow item number 9, with status Completed

Jun 18, 2015 16:48:10 UTC Executing workflow item number 10

Jun 18, 2015 16:48:10 UTC Trigger context executeWorkFlowStep called

Jun 18, 2015 16:48:11 UTC Executing custom action Add Windows VM DISK (Execute VIX Script)

Jun 18, 2015 16:48:11 UTC Executing custom action Add Windows VM DISK (Execute VIX Script) for VM 1809 (PRD-Win1-01)

Jun 18, 2015 16:48:18 UTC [VIXActionHandler] - account details VMName :PRD-Win1-01 , Host :172.17.32.113 , OS Type :microsoft windows server 2008 r2 (64-bit) , ExitCode

Jun 18, 2015 16:48:21 UTC Task #9 (Add Windows VM DISK (Execute VIX Script)) completed successfully in 10 seconds

Jun 18, 2015 16:48:21 UTC Input/Output values for Task #9 (Add Windows VM DISK (Execute VIX Script)):

Jun 18, 2015 16:48:21 UTC [Mapped Input: Select VM = 1809]

Jun 18, 2015 16:48:21 UTC [Local Input: Credential Type = Login]

Jun 18, 2015 16:48:21 UTC [Mapped Input: Login = administrator]

Jun 18, 2015 16:48:21 UTC [Mapped Input: Password = **masked-value**]

Jun 18, 2015 16:48:21 UTC [Local Input: Script = C:\\Windows\\system32\\cmd.exe '/c set /P a= < c:\\f5.txt' && C:\\Windows\\system32\\cmd.exe '/c echo select %a:~2,10% &gt; c:\\f6.txt']

Jun 18, 2015 16:48:21 UTC [Local Input: Undo Script = ]

Jun 18, 2015 16:48:21 UTC [Output: EXIT_STATUS_CODE = 0]

Jun 18, 2015 16:48:21 UTC [Output: ERROR_STATUS_MESSAGE = ]

Jun 18, 2015 16:48:21 UTC Completed workflow item number 10, with status Completed

Jun 18, 2015 16:48:26 UTC Executing workflow item number 11

Jun 18, 2015 16:48:26 UTC Trigger context executeWorkFlowStep called

Jun 18, 2015 16:48:26 UTC Executing custom action Add Windows VM DISK (Execute VIX Script)

Jun 18, 2015 16:48:26 UTC Executing custom action Add Windows VM DISK (Execute VIX Script) for VM 1809 (PRD-Win1-01)

Jun 18, 2015 16:48:34 UTC [VIXActionHandler] - account details VMName :PRD-Win1-01 , Host :172.17.32.113 , OS Type :microsoft windows server 2008 r2 (64-bit) , ExitCode

Jun 18, 2015 16:48:36 UTC Task #10 (Add Windows VM DISK (Execute VIX Script)) completed successfully in 9 seconds

Jun 18, 2015 16:48:36 UTC Input/Output values for Task #10 (Add Windows VM DISK (Execute VIX Script)):

Jun 18, 2015 16:48:36 UTC [Mapped Input: Select VM = 1809]

Jun 18, 2015 16:48:36 UTC [Local Input: Credential Type = Login]

Jun 18, 2015 16:48:36 UTC [Mapped Input: Login = administrator]

Jun 18, 2015 16:48:36 UTC [Mapped Input: Password = **masked-value**]

Jun 18, 2015 16:48:36 UTC [Template Input:Script = C:\\\\Windows\\\\system32\\\\cmd.exe '/c echo attributes disk clear readonly >> c:\\\\f6.txt' && C:\\\\Windows\\\\system32\\\\cmd.exe '/c echo convert mbr &gt;> c:\\\\f6.txt' && C:\\\\Windows\\\\system32\\\\cmd.exe '/c echo create partition primary &gt;> c:\\\\f6.txt' && C:\\\\Windows\\\\system32\\\\cmd.exe '/c echo format quick fs=ntfs label='DataDisk' &gt;> c:\\\\f6.txt' && C:\\\\Windows\\\\system32\\\\cmd.exe '/c echo assign letter=${Drive_Letter} &gt;> c:\\\\f6.txt' ]

Jun 18, 2015 16:48:36 UTC [Resolved Template Input: Script = C:\\Windows\\system32\\cmd.exe '/c echo attributes disk clear readonly >> c:\\f6.txt' && C:\\Windows\\system32\\cmd.exe '/c echo convert mbr &gt;> c:\\f6.txt' && C:\\Windows\\system32\\cmd.exe '/c echo create partition primary &gt;> c:\\f6.txt' && C:\\Windows\\system32\\cmd.exe '/c echo format quick fs=ntfs label='DataDisk' &gt;> c:\\f6.txt' && C:\\Windows\\system32\\cmd.exe '/c echo assign letter=Z &gt;> c:\\f6.txt' ]

Jun 18, 2015 16:48:36 UTC [Local Input: Script = C:\\Windows\\system32\\cmd.exe '/c echo attributes disk clear readonly >> c:\\f6.txt' && C:\\Windows\\system32\\cmd.exe '/c echo convert mbr &gt;> c:\\f6.txt' && C:\\Windows\\system32\\cmd.exe '/c echo create partition primary &gt;> c:\\f6.txt' && C:\\Windows\\system32\\cmd.exe '/c echo format quick fs=ntfs label='DataDisk' &gt;> c:\\f6.txt' && C:\\Windows\\system32\\cmd.exe '/c echo assign letter=Z &gt;> c:\\f6.txt' ]

Jun 18, 2015 16:48:36 UTC [Local Input: Undo Script = ]

Jun 18, 2015 16:48:36 UTC [Output: EXIT_STATUS_CODE = 0]

Jun 18, 2015 16:48:36 UTC [Output: ERROR_STATUS_MESSAGE = ]

Jun 18, 2015 16:48:36 UTC Completed workflow item number 11, with status Completed

Jun 18, 2015 16:48:38 UTC Executing workflow item number 12

Jun 18, 2015 16:48:38 UTC Trigger context executeWorkFlowStep called

Jun 18, 2015 16:48:39 UTC Executing custom action Add Windows VM DISK (Execute VIX Script)

Jun 18, 2015 16:48:39 UTC Executing custom action Add Windows VM DISK (Execute VIX Script) for VM 1809 (PRD-Win1-01)

Jun 18, 2015 16:48:51 UTC [VIXActionHandler] - account details VMName :PRD-Win1-01 , Host :172.17.32.113 , OS Type :microsoft windows server 2008 r2 (64-bit) , ExitCode

Jun 18, 2015 16:48:53 UTC Task #11 (Add Windows VM DISK (Execute VIX Script)) completed successfully in 14 seconds

Jun 18, 2015 16:48:53 UTC Input/Output values for Task #11 (Add Windows VM DISK (Execute VIX Script)):

Jun 18, 2015 16:48:53 UTC [Mapped Input: Select VM = 1809]

Jun 18, 2015 16:48:53 UTC [Local Input: Credential Type = Login]

Jun 18, 2015 16:48:53 UTC [Mapped Input: Login = administrator]

Jun 18, 2015 16:48:53 UTC [Mapped Input: Password = **masked-value**]

Jun 18, 2015 16:48:53 UTC [Local Input: Script = C:\\Windows\\system32\\cmd.exe '/c diskpart /s c:\\f6.txt > c:\\f7.txt']

Jun 18, 2015 16:48:53 UTC [Local Input: Undo Script = ]

Jun 18, 2015 16:48:53 UTC [Output: EXIT_STATUS_CODE = 0]

Jun 18, 2015 16:48:53 UTC [Output: ERROR_STATUS_MESSAGE = ]

Jun 18, 2015 16:48:53 UTC Completed workflow item number 12, with status Completed

Jun 18, 2015 16:48:54 UTC Executing workflow item number 13

Jun 18, 2015 16:48:54 UTC Trigger context executeWorkFlowStep called

Jun 18, 2015 16:48:54 UTC Executing custom action Add Windows VM DISK (Collect Inventory)

Jun 18, 2015 16:48:54 UTC Executing custom action Add Windows VM DISK (Collect Inventory) for VM 1809 (PRD-Win1-01)

Jun 18, 2015 16:48:57 UTC Collecting inventory for the VMware accounts: Dallas

Jun 18, 2015 16:48:57 UTC Inventory collection triggered for the VMware account: Dallas

Jun 18, 2015 16:48:57 UTC Task #12 (Add Windows VM DISK (Collect Inventory)) completed successfully in 2 seconds

Jun 18, 2015 16:48:57 UTC Input/Output values for Task #12 (Add Windows VM DISK (Collect Inventory)):

Jun 18, 2015 16:48:57 UTC [Input Section Label: VMware Accounts]

Jun 18, 2015 16:48:57 UTC [Mapped Input: VMware Account = Dallas]

Jun 18, 2015 16:48:57 UTC [Input Section Label: UCS Accounts]

Jun 18, 2015 16:48:57 UTC [Local Input: UCS Account = ]

Jun 18, 2015 16:48:57 UTC [Input Section Label: NetApp Accounts]

Jun 18, 2015 16:48:57 UTC [Local Input: NetApp Account = ]

Jun 18, 2015 16:48:57 UTC [Input Section Label: VDI Accounts]

Jun 18, 2015 16:48:57 UTC [Local Input: VDI Account = ]

Jun 18, 2015 16:48:57 UTC [Input Section Label: Network Devices]

Jun 18, 2015 16:48:57 UTC [Local Input: Network Device = ]

Jun 18, 2015 16:48:57 UTC Completed workflow item number 13, with status Completed

Jun 18, 2015 16:49:00 UTC Executing workflow item number 14

Jun 18, 2015 16:49:00 UTC Completed workflow item number 14, with status Completed

 

 

 

 

Note:

 

     If VIX has a UCSD variable all \\ turn into \\\\

 

 

Results on the VM:

 

Screen Shot 2015-06-18 at 12.14.08 PM.png

 

Screen Shot 2015-06-18 at 12.22.26 PM.png

 

New Disks on the system in UCSD:

 

Screen Shot 2015-06-18 at 12.25.24 PM.png

 

The included custom tasks:

 

Screen Shot 2015-06-18 at 12.26.21 PM.png

 

1) Get the VM summary report to obtain the data store

2) The VM may have more then one data store [san1, san2, san3]

     This task would grab san1

 

 

Here is another command option for PowerShell:

 

 

Get-Disk |

Where partitionstyle -eq 'raw' |

Initialize-Disk -partitionStyle MBR -PassThru |

New-Partition -AssignDriveLetter -UseMaximumSize |

Format-Volume -FileSystem NTFS -Confirm:$false

 

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Quick Links

Review Cisco Networking for a $25 gift card