def destroy(name)
Syncer::lock do
Machine.find(:all, :conditions => "name = '#{name}'").each do |machine|
unless machine.state == "missing" then
`func "#{machine.cloud}" call command run "virsh destroy #{machine.name}"`
`func "#{machine.cloud}" call command run "virsh undefine #{machine.name}"`
`func "#{machine.cloud}" call command run "rm -rf /etc/xen/auto/#{machine.name}"`
`func "#{machine.cloud}" call command run "rm -rf /images/#{machine.name}-disk0"`
end
machine.destroy
end
end
redirect R(Status)
end