Closed snootched closed 9 years ago
Thank you for reporting this. When I have some free time I will try to duplicate these errors and work on a solution.
@snootched
So far I am unable to duplicate this issue. Applying the following to a newly provisioned Windows 2012 R2
box results in a successful puppet run.
pagefile { 'c:\pagefile.sys':
initialsize => 200,
maximumsize => 1024
}
pagefile { 'u:\pagefile.sys':
systemmanaged => true
}
After successful puppet run:
PS C:\Program Files\Puppet Labs\Puppet Enterprise\bin> puppet resource pagefile
pagefile { 'C:\pagefile.sys':
ensure => 'present',
initialsize => '200',
maximumsize => '1024',
systemmanaged => 'false',
}
pagefile { 'U:\pagefile.sys':
ensure => 'present',
initialsize => '0',
maximumsize => '0',
systemmanaged => 'true',
}
Are using open source puppet or puppet enterprise? If you are using open source, what version of ruby are you running?
I have had similar issues on 2012 R2 before releasing version 1.2.2 where win32ole
was returning lowercase drive letters when looking for existing page files while the puppet type was munging the path parameter to a capitalized drive letter. This was fixed in release 1.2.2 by downcasing the path parameter in the type based off of the operatingsystemrelease
fact.
@ptierno Thanks for looking into this. We are running Puppet Enterprise 3.7.2 I wonder if this is a case issue on the drive letter. After your successful run - I see your drive letters are uppercase when running "puppet resource pagefile" however, when I run that command, the drive letters are lower-case (mind you, the puppet agent didn't do a succesful run.)
@snootched That is strange. When I have time I'm going to install a fresh 2012 R2. I've been testing with a cloud image. Let me see if there is a difference. The case of the drive letters seem to be the issue here although im not sure why. I'll get back to you.
@snootched Still experiencing this issue? I am still unable to reproduce
Just commenting as I myself have just ran into this issue as well. If it helps, I also get a lowercase letter returned when issuing the puppet resource command on Server 2012 R2.
I was actually able to get around the issue and everything worked normally after manually changing the pagefile to be system managed before an additional puppet run. This may be an issue that occurs due to how the pagefile was previously set.
For reference my initial page file was set as follows:
Custom Size: initial size 512MB maximum size 512MB Selected Drive C:
Automatically manage paging file size for all drives was disabled.
Hope this helps!
@velocity303 @snootched I believe II have found the issue. A commit should be coming shortly after doing some testing.
For what it's worth, I'm also running into this issue with Puppet Enterprise 3.8 with a pp similar to @snootched.
I know you said you believe you already found the issue, but let me know if I can do anything to help diagnose / test.
@TheCraiggers apologies for the delay. I have been strapped on time. I will try to get a commit in between today and tomorrow on a new branch for you to test.
@TheCraiggers @snootched @velocity303
Please test now against the github_issue_3
branch
Thanks a ton for looking into this for us, and for writing this module in the first place.
Well, the good news is it looks to have fixed the errors I was seeing. The bad news is the test I was attempting to do is still failing.
I'm attempting to add a new pagefile on another drive, and remove the default one on C:. So I have a init.pp that looks like this:
#Remove pagefile from the C drive
pagefile { 'c:\pagefile.sys':
ensure => absent,
}
#Add pagefile to the E drive
pagefile { 'e:\pagefile.sys':
ensure => present,
systemmanaged => true,
}
It seems to add the pagefile just fine to the E drive, but it's not removing the pagefile from C. At least not consistently.
I noticed the following in the ruby code (I'm by no means a ruby expert though) which looks to be hard coding the pagefile to be 'present'. Is this intended? Should I be attempting to go about this a different way? Should I open a new issue?
new(
:name => pagefile.Name,
:ensure => :present,
:initialsize => pagefile.InitialSize,
:maximumsize => pagefile.MaximumSize,
:systemmanaged => system_managed
)
@TheCraiggers that code is part of the self.instances
method which is used by the puppet resource
command, shouldn't have much to do with a puppet run. This issue may be related to how i handled ensure => absent
. I think it turns on windows automatic managed pagefile setting. can you give me the output of puppet resource pagefile
from your windows machine?
Thanks
pagefile { 'C:\pagefile.sys':
ensure => 'present',
initialsize => '0',
maximumsize => '0',
systemmanaged => 'true',
}
pagefile { 'e:\pagefile.sys':
ensure => 'present',
initialsize => '0',
maximumsize => '0',
systemmanaged => 'true',
}
Interesting it thinks the C pagefile needs to be present. I presume that's what you were talking about.
@TheCraiggers thats because the 'automatically managed' setting was enabled. I'm going to mark this issue as closed. Can you create a new issue regarding this and I will work to add the expected functionality to ensure
, or at least create a new parameter on how absent should work, either restore the default windows automatic management, or completely remove.
Running module on Windows 2012 R2 generates 'undefined method' error.
Module version:
mod 'ptierno/windowspagefile', '1.2.2'
Attemtping code:
}
Error observed: