Quantcast
Viewing all articles
Browse latest Browse all 1803

How to use a Diskpart script in provisioning

Provisioning is based on a template composed of several individual actions that each perform a single task. Once the template is selected, the client requests the first action, executes it, sends a status back to the core then requests the next action. This continues until the template is complete. Sometimes this introduces a lot of delay in tasks. This is especially seen in the Partition action. Only one operation is run at a time, and the several actions that are needed to prepare a disk can take several minutes. The Partition action uses the Microsoft tool diskpart to perform the actions. More information about diskpart can be found here: http://support.microsoft.com/kb/300415

 

One possible solution to speed up these disk operations is to take advantage of the scripting ability of diskpart. A simple text file can be created with all the commands that need to run to prepare the disk, then this script is run through diskpart very quickly. To create your script, please review the Microsoft link above which contains all the commands and syntax for diskpart.

 

Once you have a script, place it in the same location that you will be mapping to for deploying the image or running the scripted installation. You can then create 2 actions to run all your disk operations, and if you need additional disk operations later in the template, it requires just one more action.

 

The first action is a Map drive action.

 

If you would like, you may be able to just move this action further up in the template. Make sure to map to the location that your diskpart script is at.

 

Image may be NSFW.
Clik here to view.
Use diskpart script in prov - map action.JPG

 

The next action will be an Execute file action. Set it to run diskpart and provide the full path to the script that you are using.

 

Image may be NSFW.
Clik here to view.
Use diskpart script in prov - execute action.JPG

 

If you set the expected return value (not required) you will be able to detect whether it worked or not because diskpart will return a 0 if it ran the script succesfully.

 

With these actions you can script a whole series of diskpart actions or disk operations. They will all execute as part of one action making it much faster than individual Partition actions. Also if you need more operations later, it is simple to just add another Execute file action with the new script.


Viewing all articles
Browse latest Browse all 1803

Trending Articles



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