-
Notifications
You must be signed in to change notification settings - Fork 44
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
Node knife attributes doesn't get populated after restore #57
Comments
It has been seen that, certain JSON block is missing during BACKUP of the this particular entry. Other entries are working fine. |
I think I'm seeing the same thing. So I take a backup and inside the node.json appears to have the correct ipaddress and all of the attributes, but when I do a "knife backup restore nodes", I also see empty attributes on "knife node show ..." For me, I'm using: |
thx guys - I will look into this when I have a bit more. Currently swamped!!! |
Any movement on this issue? I'm attempting to migrate from one Chef server to another and knife-backup isn't restoring any of my node attributes at all as far as I can tell. |
From looking at the code, it doesn't appear like much data is actually ever repopulated by the method that ends up getting called -- either My solution was ... less than ideal. require 'chef'
require 'chef/knife'
# grab config data from old chef server
Chef::Config.from_file(File.join(Chef::Knife.chef_config_dir, 'knife.rb'))
nodes = Chef::Node.list(true) # takes a while
# switch to new chef config data in knife.rb, client.pem
Chef::Config.from_file(File.join(Chef::Knife.chef_config_dir, 'knife.rb'))
nodes.each { |(name, node)| puts "saving #{name}"; node.save }
# grab a coffee Not happy-fun-times, but it works. |
As the PR was outstanding for sometime and has now been pulled I'd add the following knife download https://docs.chef.io/knife_download.html The above commands use ChefFS http://www.rubydoc.info/gems/chef/Chef/ChefFS which runs much quicker than knife backup which iterates each Chef object and downloads them. Using knife download It is possible to download the contents of the Chef Server or individual components such as nodes, roles, environments to the filesystem. Cookbooks etc are latest versions. The contents of the folder created with knife download can then be sent back up to a new Chef Server or restored using knife upload. If individual items are to be restored you can use knife <node|role|environment> from file <downloaded_file.json> Examples.
Downloads just environments
NB: Just make sure your folder structure exists because knife download is not very good at creating folders. Restore a single node
Restore all items
Restore just environments
Finally, if you want to backup a single node you can re-direct the output of knife node show
|
Sorry guy - been really busy lately. Main issue at the moment is to test any changes against multiple chef server versions. So when problems are reported or fixes are suggested, note the chef server version as well. thanks |
I am using knife backup - restore plugin with following configuration
knife plugin version : 0.0.12
chef server version : 11.18.12
It has been found that, after restore, certain node attributes are not visible when we do "knife show node" command.
I have virtual machine, which has following attributes.
Command : knife node show falRhel6x64.ammpilot.FALCON.release.ibm.com
Output
Node Name: falRhel6x64.ammpilot.FALCON.release.ibm.com
Environment: _default
FQDN: falRhel6x64.ammpilot.FALCON.release.ibm.com
IP: 159.8.215.239
Run List: recipe[zabbix-agent::linux], role[SetupPatchingNode]
Roles: ScanForPatches
Recipes: patchservice_operations::ScanEndpoints
Platform: redhat 7.2
Tags:
When I do backup using knife backup and proceed with restore operation, same node shows following attributes when it is queried
[root@localhost ~]# knife node show falRhel6x64.ammpilot.FALCON.release.ibm.com
Node Name: falRhel6x64.ammpilot.FALCON.release.ibm.com
Environment: _default
FQDN:
IP:
Run List: recipe[zabbix-agent::linux], role[SetupPatchingNode]
Roles:
Recipes:
Platform:
Tags:
If you see, certain attributes are missing. It has been seen that, certain JSON block is missing.
The text was updated successfully, but these errors were encountered: