-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Disk: Setting fslabel on multiple partitions labels all partitions the same #196
Comments
Strange, this kind of worked on some new machines...the labels were correct but I cannot get it to work on old machines. The only difference is I upgraded from 4.2.0.0 to 4.4.0.0 and the new machines are wiped clean with the latest modules, the old machines are just upgraded and no matter what they won't get correct labels. However, there is a new odd behaviour...I've created 2xvolumes of 550GB and 2xvolumes of 75GB each called DATA & DATA2, and LOGS & LOGS2. Now I see that it creates the first of the 2x550GB volumes correctly, 550GB/F letter/DATA volume label but when that's finished it renames this volume to DATA2 and never creates the 2nd 550GB volume. This is similar to what happens with the volume labels, when it gets to the last volume it renames all the volumes the same label as the last volume is created. It seemingly doesn't seperate the individual volumes properly, but rather goes back to edit volumes created. |
Hi @ndoody - thanks for raising this. Are you possibly able to post the verbose logs from running the DSC config here (minus any identifiable info)? |
Where do I get these logs from? This is deployed through the DSC agent installed from within the azure cloud. It has the usual operational logs for DSC, and you can trick it into running a new "update-dscconfiguration" by recompiling the config in the cloud and I can take info from "Get-DSCConfigurationStatus" this way. |
This was easily repeatable on a new disk and configuration. This is the end product 👎 This is the script part run WaitForDisk Disk3 This is the "resourcesindesiredstate" output 👎 ConfigurationName : prodServers ConfigurationName : prodServers ConfigurationName : prodServers ConfigurationName : prodServers ConfigurationName : prodServers |
Thanks @ndoody - I'm having a go at replicating this now. Hopefully I have an idea where this might occur. |
Hi @ndoody - facepalm from me - I've realized what is happening here. The issue is that each the Disk resource uses the Size to determine if it should create a new volume on an existing Disk or update an existing volume. In your case, because each volume is 32GB the resource is updating the same Volume with a new label and Drive letter. This is a bit of a limitation of the Disk resource (a whole reason I've planned to rework the resources with #91). So what you should do is change the set the size of each volume to a different number (even just by just 1 byte). E.g. WaitForDisk Disk3
{
DiskId = 3
RetryIntervalSec = 60
RetryCount = 60
}
Disk GVolume
{
DiskId = 3
DriveLetter = 'G'
Size = 64.0000GB
FSFormat = 'NTFS'
FSLabel = "G"
PartitionStyle = 'GPT'
DependsOn = '[WaitForDisk]Disk3'
}
Disk HVolume
{
DiskId = 3
DriveLetter = 'H'
Size = 64.0001GB
FSFormat = 'NTFS'
FSLabel = "H"
PartitionStyle = 'GPT'
DependsOn = '[WaitForDisk]Disk3'
}
Disk IVolume
{
DiskId = 3
DriveLetter = 'I'
Size = 32.0000GB
FSFormat = 'NTFS'
FSLabel = "I"
PartitionStyle = 'GPT'
DependsOn = '[WaitForDisk]Disk3'
}
Disk JVolume
{
DiskId = 3
DriveLetter = 'J'
Size = 32.0001GB
FSFormat = 'NTFS'
FSLabel = "J"
PartitionStyle = 'GPT'
DependsOn = '[WaitForDisk]Disk3'
} Creating new more granular DiskEx, Partition and Volume resources is still my longer term plan as this would allow more precise control over the disk layout. Does that make sense? |
Thinking about this further, I think we need some better examples and documentation of this behavior until we have a good way of resolving it. |
Hi, I'm encountering a similar if not the same issue. I am trying to format an Azure P30 managed disk into 10 partitions of 50GB each. I am currently changing the size by 0.0001GB by each parition as a dirty hack. Which appears to work. I say appear because when I inspect the capacity of the partitions after formatting each one displays the same capacity in bytes which can only be true if the number is being rounded down. I don't know what implications this has for subsequent enforcement of state. |
DiskAccessPath exhibits the same behavior when creating mount points of the same size on the same disk. |
This is an unfortunate side effect of how this resource was designed. My intention was to create a new set of resources that would allow more granular control of partitions/volumes: #91 . However, it is a reasonably large job that I haven't found time to do. However, thinking about this a bit, I'm wondering if it would be possible to for us to add an optional There is some risk however with this approach: It will enable configurations that are technically invalid that can never enter state Avoiding a breaking change here is important as well. Once I've completed this PR (#242) I can take a look further. |
Could this be related? Disk CVolume VERBOSE: [server]: LCM: [ Start Resource ] [[Disk]CVolume] |
Hi @jojiklmts - I'm not certain, but this might be because of trying to set the size of C: Drive. I'd assume that this is your %SYSTEMROOT% drive so it would not be a good idea to configure it using this resource. This is most likely because your boot disk usually has one or more additional partitions on it (why C: drive is partition 4). What is the reason for applying a config to C: drive? |
I wish to use DSC as one stop shop for whole config management. It would be better if DSC was not trying to resize the partition if it was not explicitly told to do so. Just trying to contribute if I come across ignorant. |
Hi @jojiklmts - you are absolutely right to use DSC as a one stop shop for whole config management, and it is appropriate to do so. I think though the issue you're seeing is actually the same cause as this issue. This was is caused by a bug in
As you can see (this is from my machine): So, my recommendation would be to avoid using DSC Disk resource against C: Drive and/or your boot disk. Besides, if DSC did determine that something needed to be changed (for example the partition needed to be resized) then it would be a destructive action and performing that on C: drive would result in your OS being wiped. |
Thanks for your quick response. I implemented workaround. Would it anyway make sense to rewrite DSC Disk resource, not to be using Get-PartitionSupportedSize, unless the programmer wants to do something specifically with disk size? |
The challenge there is that the resource is designed so that if you don't specify a size for the partition it assumes you want to make the partition/volume consume all remaining space on the disk. We could potentially implement a flag to force ignoring the size of the partition - if the partition already exists - that would resolve the problem I think? Could you raise that as a separate issue so I can track it outside of this issue (don't want it to get lost). |
Done #246 |
When I use the Disk command to create multiple partitions on the same disk, all having their own fslabel setting then it seems to change the label to be the same on all partitions on each iteration.
The code used to set the disk partitions is as follows :
The target operating system is Windows 2016 running in Azure, using a standard 2016 installation from Microsoft.
The version is StorageDsc 4.4.0.0
The text was updated successfully, but these errors were encountered: