Examples from OSM Hackfests: Difference between revisions

From OSM Public Wiki
Jump to: navigation, search
Line 175: Line 175:
== VNF with EPA requirements ==
== VNF with EPA requirements ==


* '''VNF package:''' [https://osm-download.etsi.org/ftp/osm-4.0-four/3rd-hackfest/packages/hackfest_4_vnfd.tar.gz hackfest4-vnf]
* '''VNF package:''' [http://osm-download.etsi.org/ftp/osm-4.0-four/4th-hackfest/packages/hackfest_epasriov_vnf.tar.gz hackfest_epasriov-vnf]
* '''NS package:''' [https://osm-download.etsi.org/ftp/osm-4.0-four/3rd-hackfest/packages/hackfest_4_nsd.tar.gz hackfest4-ns]
* '''NS package:''' [http://osm-download.etsi.org/ftp/osm-4.0-four/4th-hackfest/packages/hackfest_epasriov_ns.tar.gz hackfest_epasriov-ns]
* '''Image :''' [https://osm-download.etsi.org/ftp/osm-3.0-three/1st-hackfest/images/hackfest-pktgen.qcow2 hackfest-pktgen]
* '''Image :''' [https://osm-download.etsi.org/ftp/osm-3.0-three/1st-hackfest/images/hackfest-pktgen.qcow2 hackfest-pktgen]
* '''Reference material:''' [https://osm-download.etsi.org/ftp/osm-4.0-four/3rd-hackfest/presentations/20180627%20OSM%20Hackfest%20-%20Session%205%20-%20Modeling%20EPA%20capabilities%20in%20VNF.pdf Modeling EPA capabilities in your VNF descriptor]
* '''Reference material:''' [https://osm-download.etsi.org/ftp/osm-4.0-four/4th-hackfest/presentations/20181102%20OSM%20Hackfest%20-%20Session%205%20-%20Modeling%20EPA%20capabilities%20in%20VNF.pdf Modeling EPA capabilities in your VNF descriptor]


===VNF diagram===
===VNF diagram===
Line 190: Line 190:
===Testing with OSM client===
===Testing with OSM client===
*Onboard VNF packages
*Onboard VNF packages
  osm vnfd-create hackfest4_vnfd.tar.gz
  osm vnfd-create hackfest_epasriov_vnf.tar.gz
  osm vnfd-list
  osm vnfd-list
  osm vnfd-show hackfest4-vnf
  osm vnfd-show hackfest_epasriov-vnf
*Onboard NS packages
*Onboard NS packages
  osm nsd-create hackfest4_nsd.tar.gz
  osm nsd-create hackfest_epasriov_ns.tar.gz
  osm nsd-list
  osm nsd-list
  osm nsd-show hackfest4-ns
  osm nsd-show hackfest_epasriov-ns
*Instantiate
*Instantiate
  osm ns-create --ns_name hf4 --nsd_name hackfest4-ns \
  osm ns-create --ns_name hf_epasriov --nsd_name hackfest_epasriov-ns \
   --vim_account <VIM_ACCOUNT_NAME>|<VIM_ACCOUNT_ID>  
   --vim_account <VIM_ACCOUNT_NAME>|<VIM_ACCOUNT_ID>  
*Check NS status
*Check NS status
  osm ns-list
  osm ns-list
  osm ns-show hf4
  osm ns-show hf_epasriov
*Check VNF instances to see the instance and get the mgmt IP address of the VNF
*Check VNF instances to see the instance and get the mgmt IP address of the VNF
  osm vnf-list
  osm vnf-list
Line 219: Line 219:
*Instantiate NS
*Instantiate NS
  Go to NS packages
  Go to NS packages
  In hackfest4-ns, click in “Actions: Instantiate NS”
  In hackfest_epasriov-ns, click in “Actions: Instantiate NS”
     -Complete the form
     -Complete the form
     -Add a name to the NS instance
     -Add a name to the NS instance
Line 230: Line 230:
           ssh -i test4.pem ubuntu<IP_dataVM>
           ssh -i test4.pem ubuntu<IP_dataVM>
           Run pktgen
           Run pktgen


== VNF with Day-1/Day-2 configuration (adding a charm) ==
== VNF with Day-1/Day-2 configuration (adding a charm) ==

Revision as of 15:41, 5 December 2018

Examples from the 4th OSM Hackfest

Hackfest material

Examples

Basic VNF and NS

VNF diagram

Hackfest simple vnf.png

VNF descriptor

{{#iDisplay:https://osm.etsi.org/gitweb/?p=osm/devops.git;a=blob_plain;f=descriptor-packages/vnfd/hackfest_basic_vnf/src/hackfest_basic_vnfd.yaml;%7C800%%7C300}}

NS diagram

Hackfest simple ns.png

NS descriptor

{{#iDisplay:https://osm.etsi.org/gitweb/?p=osm/devops.git;a=blob_plain;f=descriptor-packages/nsd/hackfest_basic_ns/src/hackfest_basic_nsd.yaml;%7C800%%7C300}}

Testing with OSM client

  • Onboard VNF packages
osm vnfd-create hackfest_basic_vnf.tar.gz
osm vnfd-list
osm vnfd-show hackfest_basic-vnf
  • Onboard NS packages
osm nsd-create hackfest_basic_ns.tar.gz
osm nsd-list
osm nsd-show hackfest_basic-ns
  • Instantiate
osm ns-create --ns_name hf_basic --nsd_name hackfest_basic-ns \
  --vim_account <VIM_ACCOUNT_NAME>|<VIM_ACCOUNT_ID> \
  --ssh_keys <KEY1_PUBKEY_FILE> \
  --config '{vld: [ {name: mgmtnet, vim-network-name: <VIM_MGMT_NAME>} ] }'
  • Check NS status
osm ns-list
osm ns-show hf_basic
  • Check VNF instances to see the instance and get the mgmt IP address of the VNF
osm vnf-list
osm vnf-show <VNF ID>
  • Connect to the VNF
ssh -i <priv_key> ubuntu@<IP>

Testing with OSM UI

  • Onboard VNF package
Go to VNF packages
Drag and drop the VNF package to the ...
  • Onboard NS package
Drag and drop the NS package to the ...
  • Instantiate NS
Go to NS packages
In hackfest_basic-ns, click in “Actions: Instantiate NS”
Complete the form:
    -Add a name to the NS instance
    -Select the Datacenter where the NS will be deployed
    -Specify in the config section a default VIM network name to map “mgmtnet”:
    -Paste your public SSH key to get access to the VNF (VMs need to have cloud-init enabled, in this case the hackfest basic example has cloud-init)
  • Connect to the VNF:
ssh -i <priv_key> ubuntu@<IP>

Multi-VDU VNF

VNF diagram

Hackfest multivdu vnf.png

VNF descriptor

{{#iDisplay:https://osm.etsi.org/gitweb/?p=osm/devops.git;a=blob_plain;f=descriptor-packages/vnfd/hackfest_multivdu_vnf/src/hackfest_multivdu_vnfd.yaml;%7C800%%7C300}}

NS diagram

Hackfest multivdu ns.png

NS descriptor

{{#iDisplay:https://osm.etsi.org/gitweb/?p=osm/devops.git;a=blob_plain;f=descriptor-packages/nsd/hackfest_multivdu_ns/src/hackfest_multivdu_nsd.yaml;%7C800%%7C300}}

Testing with OSM client

  • Onboard VNF packages
osm vnfd-create hackfest_multivdu_vnf.tar.gz
osm vnfd-list
osm vnfd-show hackfest_multivdu-vnf
  • Onboard NS packages
osm nsd-create hackfest_multivdu_ns.tar.gz
osm nsd-list
osm nsd-show hackfest_multivdu-ns
  • Instantiate
osm ns-create --ns_name hf_multivdu --nsd_name hackfest_multivdu-ns \
  --vim_account <VIM_ACCOUNT_NAME>|<VIM_ACCOUNT_ID> 
  • Check NS status
osm ns-list
osm ns-show hf_multivdu
  • Check VNF instances to see the instance and get the mgmt IP address of the VNF
osm vnf-list
osm vnf-show <VNF ID>
  • Connect to the VNF
ssh osm@<IP> (pwd:osm4u)

Testing with OSM UI

  • Onboard VNF package
Go to VNF packages
Drag and drop the VNF package to the ...
  • Onboard NS package
Drag and drop the NS package to the ...
  • Instantiate NS
Go to NS packages
In hackfest_multivdu-ns, click in “Actions: Instantiate NS”
    -Complete the form
    -Add a name to the NS instance
    -Select the Datacenter where the NS will be deployed
    -Specify in the config section a default VIM network name to map “MGMTNET”:
    -Click the info button to see the mgmt IP address
  • Connect to each VNF:
ssh osm@<IP>  (pwd:osm4u)

VNF with Day-0 configuration

VNF diagram

Cloudinit vnf.png

VNF descriptor

{{#iDisplay:https://osm.etsi.org/gitweb/?p=osm/devops.git;a=blob_plain;f=descriptor-packages/vnfd/hackfest_cloudinit_vnf/src/hackfest_cloudinit_vnfd.yaml;%7C800%%7C300}}

NS diagram

Cloudinit ns.png

NS descriptor

{{#iDisplay:https://osm.etsi.org/gitweb/?p=osm/devops.git;a=blob_plain;f=descriptor-packages/nsd/hackfest_cloudinit_ns/src/hackfest_cloudinit_nsd.yaml;%7C800%%7C300}}

Testing with OSM client

  • Onboard VNF packages
osm vnfd-create hackfest_cloudinit_vnfd.tar.gz
osm vnfd-list
osm vnfd-show hackfest_cloudinit-vnf
  • Onboard NS packages
osm nsd-create hackfest_cloudinit_nsd.tar.gz
osm nsd-list
osm nsd-show hackfest_cloudinit-ns
  • Instantiate
osm ns-create --ns_name hf_cloudinit --nsd_name hackfest_cloudinit-ns \
  --vim_account <VIM_ACCOUNT_NAME>|<VIM_ACCOUNT_ID> 
  • Check NS status
osm ns-list
osm ns-show hf_cloudinit
  • Check VNF instances to see the instance and get the mgmt IP address of the VNF
osm vnf-list
osm vnf-show <VNF ID>
  • Connect to the VNF
ssh osm@<IP> (pwd:osm4u)  #The password to the default user was injected via cloud-init
    Check that Cloud init worked:
         sudo ls /root/helloworld.txt
         sudo cat /root/helloworld.txt

Testing with OSM UI

  • Onboard VNF package
Go to VNF packages
Drag and drop the VNF package to the ...
  • Onboard NS package
Drag and drop the NS package to the ...
  • Instantiate NS
Go to NS packages
In hackfest3-ns, click in “Actions: Instantiate NS”
    -Complete the form
    -Add a name to the NS instance
    -Select the Datacenter where the NS will be deployed
    -Specify in the config section a default VIM network name to map “MGMTNET”:
    -Click the info button to see the mgmt IP address
  • Connect to the VNF
ssh osm@<IP> (pwd:osm4u)  #The password to the default user was injected via cloud-init
    Check that Cloud init worked:
         sudo ls /root/helloworld.txt
         sudo cat /root/helloworld.txt

VNF with EPA requirements

VNF diagram

Epasriov vnf.jpg

VNF descriptor

{{#iDisplay:https://osm.etsi.org/gitweb/?p=osm/devops.git;a=blob_plain;f=descriptor-packages/vnfd/hackfest_epasriov_vnf/src/hackfest_epasriov_vnfd.yaml;%7C800%%7C300}}

NS diagram

Hackfest epasriov ns.png

NS descriptor

{{#iDisplay:https://osm.etsi.org/gitweb/?p=osm/devops.git;a=blob_plain;f=descriptor-packages/nsd/hackfest_epasriov_ns/src/hackfest_epasriov_nsd.yaml;%7C800%%7C300}}

Testing with OSM client

  • Onboard VNF packages
osm vnfd-create hackfest_epasriov_vnf.tar.gz
osm vnfd-list
osm vnfd-show hackfest_epasriov-vnf
  • Onboard NS packages
osm nsd-create hackfest_epasriov_ns.tar.gz
osm nsd-list
osm nsd-show hackfest_epasriov-ns
  • Instantiate
osm ns-create --ns_name hf_epasriov --nsd_name hackfest_epasriov-ns \
  --vim_account <VIM_ACCOUNT_NAME>|<VIM_ACCOUNT_ID> 
  • Check NS status
osm ns-list
osm ns-show hf_epasriov
  • Check VNF instances to see the instance and get the mgmt IP address of the VNF
osm vnf-list
osm vnf-show <VNF ID>
  • Connect to the VNF (Do the same in both VNFs)
ssh ubuntu@<MGMT_IP> (pwd:osm4u)  #The password to the default user was injected via cloud-init
    Check that EPA is working:
         ssh -i test4.pem ubuntu<IP_dataVM>
         Run pktgen

Testing with OSM UI

  • Onboard VNF package
Go to VNF packages
Drag and drop the VNF package to the ...
  • Onboard NS package
Drag and drop the NS package to the ...
  • Instantiate NS
Go to NS packages
In hackfest_epasriov-ns, click in “Actions: Instantiate NS”
    -Complete the form
    -Add a name to the NS instance
    -Select the Datacenter where the NS will be deployed
    -Specify in the config section a default VIM network name to map “MGMTNET”:
    -Click the info button to see the mgmt IP address
  • Connect to the VNF (Do the same in both VNFs)
ssh ubuntu@<MGMT_IP> (pwd:osm4u)  #The password to the default user was injected via cloud-init
    Check that EPA is working:
         ssh -i test4.pem ubuntu<IP_dataVM>
         Run pktgen

VNF with Day-1/Day-2 configuration (adding a charm)

VNF diagram

Simplecharm vnf.jpg

VNF descriptor

{{#iDisplay:https://osm.etsi.org/gitweb/?p=osm/devops.git;a=blob_plain;f=descriptor-packages/vnfd/hackfest_simplecharm_vnf/src/hackfest_simplecharm_vnfd.yaml;%7C800%%7C300}}

NS diagram

Simplecharm ns.jpg

NS descriptor

{{#iDisplay:https://osm.etsi.org/gitweb/?p=osm/devops.git;a=blob_plain;f=descriptor-packages/nsd/hackfest_simplecharm_ns/src/hackfest_simplecharm_nsd.yaml;%7C800%%7C300}}

Testing with OSM client

  • Onboard VNF packages
osm vnfd-create hackfest3_simplecharm_vnf.tar.gz
osm vnfd-list
osm vnfd-show hackfest3charmed-vnf
  • Onboard NS packages
osm nsd-create hackfest_simplecharm_ns.tar.gz
osm nsd-list
osm nsd-show hackfest3charmed-ns
  • Instantiate
osm ns-create --ns_name hackfest3charmed --nsd_name hackfest3charmed-ns \
  --vim_account <VIM_ACCOUNT_NAME>|<VIM_ACCOUNT_ID> 
  • Check NS status
osm ns-list
osm ns-show hackfest3charmed
  • Check VNF instances to see the instance and get the mgmt IP address of the VNF
osm vnf-list
osm vnf-show <VNF ID>
  • Connect to the VNF (Do the same in both VNFs) and check the Charm
ssh ubuntu@<MGMT_IP> (pwd:osm4u)  #The password to the default user was injected via cloud-init
Check that file /home/ubuntu/first-touch exists (this file is created by the charm):
ls  /home/ubuntu/first-touch
  • Create the action for the Charm
osm ns-action hackfest3charmed --vnf_name 1 --action_name touch --params '{filename: /home/ubuntu/mytouch1}' (Returns an operation ID)
osm ns-op-list hackfest3charmed
osm ns-op-show OP_ID
  • Check that the file were created from the actions
ssh ubuntu@<MGMT_IP>
ls /home/ubuntu/mytouch1


Testing with OSM UI

  • Onboard VNF package
Go to VNF packages
Drag and drop the VNF package to the ...
  • Onboard NS package
Drag and drop the NS package to the ...
  • Instantiate NS
Go to NS packages
In hackfest3-simplecharm-ns, click in “Actions: Instantiate NS”
    -Complete the form
    -Add a name to the NS instance
    -Select the Datacenter where the NS will be deployed
    -Specify in the config section a default VIM network name to map “MGMTNET”:
    -Click the info button to see the mgmt IP address
  • Connect to the VNF (Do the same in both VNFs) and check the Charm
ssh ubuntu@<MGMT_IP> (pwd:osm4u)  #The password to the default user was injected via cloud-init
Check that file /home/ubuntu/first-touch exists (this file is created by the charm):
ls  /home/ubuntu/first-touch
  • Create the action for the Charm
osm ns-action hackfest3charmed --vnf_name 1 --action_name touch --params '{filename: /home/ubuntu/mytouch1}' (Returns an operation ID)
osm ns-op-list hackfest3charmed
osm ns-op-show OP_ID
  • Check that the file were created from the actions
ssh ubuntu@<MGMT_IP>
ls /home/ubuntu/mytouch1