1
votes

I need to format a disk for servers using DSC. I tried using the below from

https://blogs.msdn.microsoft.com/timomta/2016/04/23/how-to-use-powershell-dsc-to-prepare-a-data-drive-on-an-azure-vm/#comment-1865

But it doesnt work as it doesn't seem to be complete, I get errors

"+ xWaitforDisk Disk2 + ~~~~~~~~~~~~ Resource 'xWaitForDisk' requires that a value of type 'String' be provided for property 'DiskId'.

At line:18 char:1 + DiskNumber = 2 + ~~~~~~~~~~ The member 'DiskNumber' is not valid. Valid members are 'DependsOn', 'DiskId', 'DiskIdType', 'PsDscRunAsCredential', 'RetryCount', 'RetryIntervalSec'. "

Configuration DataDisk
{
    Import-DSCResource -ModuleName xStorage
    Node localhost
    {
        xWaitforDisk Disk2
        {
            DiskNumber = 2
            RetryIntervalSec = 60
            Count = 60
        }
    xDisk FVolume
    {
        DiskNumber = 2
        DriveLetter = 'F'
        FSLabel = 'Data'
    }
}
1
Read the error meassge. This DSC Resource doesnt have a property called DiskNumber and the property DiskID is rquiredguiwhatsthat
do you know how to get this diskid? I read the error ,yes but not sure how diskid fits into this, this was an example downloaded from a blog with no explanation or refence to disk id. can you advise or can you provide an example of how to do this?itye1970

1 Answers

1
votes

You need to replace DiskNumber with DiskID.

Take a look at the examples on GitHub https://github.com/PowerShell/StorageDsc/tree/dev/Modules/StorageDsc/Examples/Resources

You can find the DiskId with powershell use the command: Get-Disk