Skip to content

Instantly share code, notes, and snippets.

@Ladas
Ladas / cloud_networking.dot
Last active February 17, 2016 10:30 — forked from Fryguy/cloud_networking.dot
Networking rearchitecture
digraph CloudNetworking {
graph [ fontname="Helvetica-Bold" ]
node [ id="\N" shape="Mrecord" style="filled" fontname="Helvetica" fillcolor="#ffffff" penwidth="2" ]
edge [ arrowsize="0.5" fontname="Helvetica" ]
label = "Cloud Networking"
style = "rounded"
openstack_provider [label="OpenstackProvider"]
@Ladas
Ladas / active_record_undefined_owner_bug.rb
Created April 4, 2016 13:00
Rails bug NoMethodError: undefined method `owners' for ActiveRecord::Associations::Preloader::NullPreloader:Class
begin
require 'bundler/inline'
rescue LoadError => e
$stderr.puts 'Bundler version 1.10 or later is required. Please update your Bundler'
raise e
end
gemfile(true) do
source 'https://rubygems.org'
gem 'rails', github: 'rails/rails'
@Ladas
Ladas / create_vnf.rb
Last active May 27, 2016 09:02
parameterized vnfd
# Fog call
params = YAML.dump({'vdus' => {'vdu1' => {'param' => {'image_name' => 'cirros', 'flavor_name' => 'm1.tiny'}}}})
service.vnfs.create(:vnf=>{:name=>"LadasLegacyTemplateTest",
:vnfd_id=>"78c6c90c-6cbc-45a1-8bc1-62de91494eae",
:attributes => {:param_values => params}})
@Ladas
Ladas / create_vnf.rb
Created May 27, 2016 09:11
create_tosca_vnf
# fog_call
params = YAML.dump({'topology_template' => {'node_templates' => {'VDU1' => {'param' => {'image_name' => 'cirros'}}}}})
service.vnfs.create(:vnf=>{:name=>"openWRTLadas",
:vnfd_id=>"d5b01e96-3878-4c30-9ca4-aa3a26f272c7",
:attributes => {:param_values => params}})
{:vnf=>{:name=>"paramtest",
:vnfd_id=>"ba49e22e-1d85-491f-859f-2d9afa2ab952",
:attributes=>{:param_values => {:flavor_name => 'm1.tiny', :image_name => 'cirros'}}
}}
service.vnfs.create(create_options)
2016-05-27 16:58:43.447 25787 TRACE tacker.api.v1.resource DBError: (_mysql_exceptions.ProgrammingError) (1064, 'You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near \': "\'m1.tiny\'", u\'image_name\': "\'cirros\'"})\' at line 1') [SQL: u'INSERT INTO deviceattributes (id, device_id, `key`, value) VALUES (%s, %s, %s, %s)'] [parameters: ('a7e429ac-29ad-49d0-9a8e-8e6d58d1bca0', '8525ded5-1524-4d06-8a48-ed3a42364d5f', 'param_values', {u'flavor_name': u'm1.tiny', u'image_name': u'cirros'})]
@Ladas
Ladas / deploy_vnf.rb
Created May 30, 2016 12:11
Woroking Parameterized Tosca template
params = JSON.dump({'image_name' => 'cirros', 'flavor_name' => 'm1.small'})
service.vnfs.create(:vnf=>{:name=>"openwrtLadasParametrized",
:vnfd_id=>"ba49e22e-1d85-491f-859f-2d9afa2ab952",
:attributes => {:param_values => params}})
@Ladas
Ladas / cloud_router_vnfd.yaml
Last active June 26, 2017 09:32
Working NSD and VNFD
tosca_definitions_version: tosca_simple_profile_for_nfv_1_0_0
description: OPNFV-Demo-flavor
# NOT USED
#imports:
# - tacker_nfv_defs.yaml
# - tacker_defs.yaml
metadata:
@Ladas
Ladas / amazon_cfn_automate.rb
Last active June 13, 2016 14:45
ManageIQ automate code for creating and deploying CFN template
def template_interface(name, subnet_id, security_group)
eip = "#{name}Address"
eip_association = "Associate#{name}"
network_interface = "#{name}"
{
eip => {
"Type"=>"AWS::EC2::EIP",
"Properties"=>{"Domain"=>"vpc"}},
eip_association => {
"Type"=>"AWS::EC2::EIPAssociation",
@Ladas
Ladas / ansible_nsd.yaml
Last active June 20, 2016 09:26
NSD and VNFD conected to ansiible
tosca_definitions_version: tosca_simple_profile_for_nfv_1_0_0
description: OPNFV demo NSD
metadata:
ID: OPNFV demo # ID of this Network Service Descriptor
vendor: Red Hat Inc. # Provider or vendor of the Network Service
version: 1 # Version of the Network Service Descriptor
topology_template:
@Ladas
Ladas / nsd.yaml
Last active June 20, 2016 14:18
Final NSD with ansible and network
tosca_definitions_version: tosca_simple_profile_for_nfv_1_0_0
description: OPNFV demo NSD
metadata:
ID: OPNFV demo # ID of this Network Service Descriptor
vendor: Red Hat Inc. # Provider or vendor of the Network Service
version: 1 # Version of the Network Service Descriptor
topology_template: