Skip to content
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

OpticalDiskDriveLetter: If optical drive is not present, the behaviour of the ressource should change if "Ensure" is set to "Absent" #194

Closed
AlexGitHubAcc opened this issue Feb 19, 2019 · 5 comments · Fixed by #235
Assignees
Labels
enhancement The issue is an enhancement request. in progress The issue is being actively worked on by someone.

Comments

@AlexGitHubAcc
Copy link

Details of the scenario you tried and the problem that is occurring

Sometimes you get an optical drive in a Vm deployed to Azure and sometimes not. That's why I tkink it may be handy to make sure there's no optical drive through the usage of the 'OpticalDiskDriveLetter' resource.

If the VM does not use an optical drive and the 'Ensure' parameter is set to 'Absent', the resource returns an error, which will also stop the whole DSC configuration run with an error result.

Verbose logs showing the problem

Event viewer:

MIResult: 1
Error Message: PowerShell DSC resource MSFT_OpticalDiskDriveLetter  failed to execute Test-TargetResource functionality with error message: The optical disk 1 could not be found in the system, so this resource has nothing to do. This resource does not change the drive letter of mounted ISOs.
Parameter name: DiskId 
Message ID: ProviderOperationExecutionFailure
Error Category: 7
Error Code: 1
Error Type: MI

Job {22C5A49F-345F-11E9-A811-000D3A25D8DA} : 
This event indicates that failure happens when LCM is processing the configuration. Error Id is 0x1. Error Detail is The SendConfigurationApply function did not succeed.. Resource Id is [OpticalDiskDriveLetter]RemoveFirstOpticalDiskDriveLetter and Source Info is ::49::9::OpticalDiskDriveLetter. Error Message is PowerShell DSC resource MSFT_OpticalDiskDriveLetter  failed to execute Test-TargetResource functionality with error message: The optical disk 1 could not be found in the system, so this resource has nothing to do. This resource does not change the drive letter of mounted ISOs.
Parameter name: DiskId .

Job {22C5A49F-345F-11E9-A811-000D3A25D8DA} : 
Message The optical disk 1 could not be found in the system, so this resource has nothing to do. This resource does not change the drive letter of mounted ISOs.
Parameter name: DiskId 
HResult -2146233087 
StackTrack    at System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input)
   at System.Management.Automation.PowerShell.Worker.ConstructPipelineAndDoWork(Runspace rs, Boolean performSyncInvoke)
   at System.Management.Automation.PowerShell.Worker.CreateRunspaceIfNeededAndDoWork(Runspace rsToUse, Boolean isSync)
   at System.Management.Automation.PowerShell.CoreInvokeHelper[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings)
   at System.Management.Automation.PowerShell.CoreInvoke[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings)
   at System.Management.Automation.PowerShell.Invoke(IEnumerable input, PSInvocationSettings settings)
   at Microsoft.PowerShell.DesiredStateConfiguration.Internal.ResourceProviderAdapter.ExecuteCommand(PowerShell powerShell, ResourceModuleInfo resInfo, String operationCmd, List`1 acceptedProperties, CimInstance nonResourcePropeties, CimInstance resourceConfiguration, LCMDebugMode debugMode, PSInvocationSettings pSInvocationSettings, UInt32& resultStatusHandle, Collection`1& result, ErrorRecord& errorRecord, PSModuleInfo localRunSpaceModuleInfo)

DscConfigurationLog (Get-AzureRmVMDscExtensionStatus)

[ERROR] PowerShell DSC resource MSFT_OpticalDiskDriveLetter  failed to execute Test-TargetResource functionality with error message: The optical disk 1 could not be found in the system, so this resource has nothing to do. This resource does not change the drive letter of mounted ISOs.
Parameter name: DiskId
[ERROR] The SendConfigurationApply function did not succeed. LCM failed to start desired state configuration manually.

Suggested solution to the issue

The solution shoud handle this scenrio in a more error resistant way, e.g. checking the information in the 'Ensure' parameter before firing an exception and thus stop the whole DSC configuration run.

The DSC configuration that is used to reproduce the issue (as detailed as possible)

OpticalDiskDriveLetter RemoveFirstOpticalDiskDriveLetter
{
    DiskId      = 1
    DriveLetter = 'X' # This value is ignored
    Ensure      = 'Absent'
}

The operating system the target node is running

OsName : Microsoft Windows Server 2016 Datacenter
OsOperatingSystemSKU : DatacenterServerEdition
OsArchitecture : 64-bit
WindowsBuildLabEx : 14393.2791.amd64fre.rs1_release.190205-1511
OsLanguage : en-US
OsMuiLanguages : {en-US}

Version and build of PowerShell the target node is running

PSVersion 5.1.14393.2791
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.14393.2791
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1

Version of the DSC module that was used ('dev' if using current dev branch)

Manifest 4.4.0.0 StorageDsc

@PlagueHO PlagueHO added enhancement The issue is an enhancement request. help wanted The issue is up for grabs for anyone in the community. labels Feb 20, 2019
@PlagueHO
Copy link
Member

Thanks for raising this @AlexGitHubAcc - that sounds like a good idea. We'll leave the enhancement open for community feedback and then look at getting onto it.

@ricohomewood
Copy link

This is still an annoying issue in the Azure world. As some of the VM series Hyper-V clusters in Microsoft datacenters have optical disks and some don't.

@PlagueHO @SteveL-MSFT Is there any movement on trying to fix this bug?

@PlagueHO
Copy link
Member

PlagueHO commented Apr 1, 2020

Hi @ricohomewood. I'll work on this once I've completed the update to the new pipeline. Without that we cant release any changes. I'm hoping to get this finished this week. Sorry about the delay.

@ricohomewood
Copy link

Hi @PlagueHO any update on the above at all? Am i right in thinking the new pipeline is now in place?

@PlagueHO
Copy link
Member

Thank you for reminding me @ricohomewood !

@PlagueHO PlagueHO self-assigned this May 3, 2020
@PlagueHO PlagueHO added in progress The issue is being actively worked on by someone. and removed help wanted The issue is up for grabs for anyone in the community. labels May 3, 2020
PlagueHO added a commit to PlagueHO/StorageDsc that referenced this issue May 3, 2020
PlagueHO added a commit that referenced this issue May 3, 2020
OpticalDiskDriveLetter: Suppress No Drive Exception - Fixes #194
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement The issue is an enhancement request. in progress The issue is being actively worked on by someone.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants