Hi Guys,

I am getting error while creating snapshots.


===
volumes = conn.volumes.all().to_json

js = JSON.parse( volumes )

js.each { |k,v|
  key = k
  value = v
        volumesid = key['id']
        serverid = key['server_id']

         if serverid == "#{instanceid}"


# getting the instance name

   instance = conn.servers.get("#{instanceid}")



snapshot = conn.snapshots.new

snapshot.description = "Autosnap instance name:  instance id:  #{serverid} 
of volume id:  #{volumesid}"
snapshot.volume_id = "#{volumesid}"


snapshot.save

conn.tags.create(:resource_id => snapshot.id, :key => "saas", :value => 
"snapshot", :key => "customername", :value => "#{instancename}" )


===




snapshot.rb:84:in `block (3 levels) in <main>': undefined method `id' for 
nil:NilClass (NoMethodError)\n\tfrom snapshot.rb:52:in `each'\n\tfrom 
snapshot.rb:52:in `block (2 levels) in <main>'\n\tfrom /snapshot.rb:34:in 
`each'\n\tfrom snapshot.rb:34:in `block in <main>'\n\tfrom 
snapshot.rb:12:in `each'\n\tfrom snapshot.rb:12:in `<main>'", 


-- 
You received this message because you are subscribed to the Google Groups 
"ruby-fog" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ruby-fog+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to