Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
testbed-manual
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
emulab
testbed-manual
Commits
4b8fcb15
Commit
4b8fcb15
authored
Jun 27, 2018
by
Robert Ricci
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add code for layer1 examples
parent
aea8b2c9
Pipeline
#2501
passed with stages
in 2 minutes and 59 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
177 additions
and
0 deletions
+177
-0
code-samples/profile/PortalProfiles/layer1-2pcs.py
code-samples/profile/PortalProfiles/layer1-2pcs.py
+42
-0
code-samples/profile/PortalProfiles/layer1-2sws-2pcs.py
code-samples/profile/PortalProfiles/layer1-2sws-2pcs.py
+73
-0
code-samples/profile/PortalProfiles/layer1-sw-2pcs.py
code-samples/profile/PortalProfiles/layer1-sw-2pcs.py
+62
-0
No files found.
code-samples/profile/PortalProfiles/layer1-2pcs.py
0 → 100644
View file @
4b8fcb15
"""This profile allocates two bare metal nodes and connects them directly together via a layer1 link.
Instructions:
Click on any node in the topology and choose the `shell` menu item. When your shell window appears, use `ping` to test the link."""
# Import the Portal object.
import
geni.portal
as
portal
# Import the ProtoGENI library.
import
geni.rspec.pg
as
pg
# Import the Emulab specific extensions.
import
geni.rspec.emulab
as
emulab
# Create a portal context.
pc
=
portal
.
Context
()
# Create a Request object to start building the RSpec.
request
=
pc
.
makeRequestRSpec
()
# Do not run snmpit
#request.skipVlans()
# Add a raw PC to the request and give it an interface.
node1
=
request
.
RawPC
(
"node1"
)
iface1
=
node1
.
addInterface
()
# Specify the IPv4 address
iface1
.
addAddress
(
pg
.
IPv4Address
(
"192.168.1.1"
,
"255.255.255.0"
))
# Add another raw PC to the request and give it an interface.
node2
=
request
.
RawPC
(
"node2"
)
iface2
=
node2
.
addInterface
()
# Specify the IPv4 address
iface2
.
addAddress
(
pg
.
IPv4Address
(
"192.168.1.2"
,
"255.255.255.0"
))
# Add L1 link from node1 to node2
link1
=
request
.
L1Link
(
"link1"
)
link1
.
addInterface
(
iface1
)
link1
.
addInterface
(
iface2
)
# Print the RSpec to the enclosing page.
pc
.
printRequestRSpec
(
request
)
code-samples/profile/PortalProfiles/layer1-2sws-2pcs.py
0 → 100644
View file @
4b8fcb15
"""This profile allocates two bare metal nodes and connects them together via two Dell switches with layer1 links.
Instructions:
Click on any node in the topology and choose the `shell` menu item. When your shell window appears, use `ping` to test the link.
You will be able to ping the other node through the switch fabric. We have installed a minimal configuration on your
switches that enables the ports that are in use, and turns on spanning-tree (RSTP) in case you inadvertently created a loop with your topology. All
unused ports are disabled. The ports are in Vlan 1, which effectively gives a single broadcast domain. If you want anything fancier, you will need
to open up a shell window to your switches and configure them yourself.
If your topology has more then a single switch, and you have links between your switches, we will enable those ports too, but we do not put them into
switchport mode or bond them into a single channel, you will need to do that yourself.
If you make any changes to the switch configuration, be sure to write those changes to memory. We will wipe the switches clean and restore a default
configuration when your experiment ends."""
# Import the Portal object.
import
geni.portal
as
portal
# Import the ProtoGENI library.
import
geni.rspec.pg
as
pg
# Import the Emulab specific extensions.
import
geni.rspec.emulab
as
emulab
# Create a portal context.
pc
=
portal
.
Context
()
# Create a Request object to start building the RSpec.
request
=
pc
.
makeRequestRSpec
()
# Do not run snmpit
#request.skipVlans()
# Add a raw PC to the request and give it an interface.
node1
=
request
.
RawPC
(
"node1"
)
iface1
=
node1
.
addInterface
()
# Specify the IPv4 address
iface1
.
addAddress
(
pg
.
IPv4Address
(
"192.168.1.1"
,
"255.255.255.0"
))
# Add first switch to the request and give it a couple of interfaces
mysw1
=
request
.
Switch
(
"mysw1"
);
mysw1
.
hardware_type
=
"dell-s4048"
sw1iface1
=
mysw1
.
addInterface
()
sw1iface2
=
mysw1
.
addInterface
()
# Add second switch to the request and give it a couple of interfaces
mysw2
=
request
.
Switch
(
"mysw2"
);
mysw2
.
hardware_type
=
"dell-s4048"
sw2iface1
=
mysw2
.
addInterface
()
sw2iface2
=
mysw2
.
addInterface
()
# Add another raw PC to the request and give it an interface.
node2
=
request
.
RawPC
(
"node2"
)
iface2
=
node2
.
addInterface
()
# Specify the IPv4 address
iface2
.
addAddress
(
pg
.
IPv4Address
(
"192.168.1.2"
,
"255.255.255.0"
))
# Add L1 link from node1 to mysw1
link1
=
request
.
L1Link
(
"link1"
)
link1
.
addInterface
(
iface1
)
link1
.
addInterface
(
sw1iface1
)
# Add L1 link from mysw1 to mysw2
trunk
=
request
.
L1Link
(
"trunk"
)
trunk
.
addInterface
(
sw1iface2
)
trunk
.
addInterface
(
sw2iface2
)
# Add L1 link from node2 to mysw2
link2
=
request
.
L1Link
(
"link2"
)
link2
.
addInterface
(
iface2
)
link2
.
addInterface
(
sw2iface1
)
# Print the RSpec to the enclosing page.
pc
.
printRequestRSpec
(
request
)
code-samples/profile/PortalProfiles/layer1-sw-2pcs.py
0 → 100644
View file @
4b8fcb15
"""This profile allocates two bare metal nodes and connects them together via a Dell switch with layer1 links.
Instructions:
Click on any node in the topology and choose the `shell` menu item. When your shell window appears, use `ping` to test the link.
You will be able to ping the other node through the switch fabric. We have installed a minimal configuration on your
switches that enables the ports that are in use, and turns on spanning-tree (RSTP) in case you inadvertently created a loop with your topology. All
unused ports are disabled. The ports are in Vlan 1, which effectively gives a single broadcast domain. If you want anything fancier, you will need
to open up a shell window to your switches and configure them yourself.
If your topology has more then a single switch, and you have links between your switches, we will enable those ports too, but we do not put them into
switchport mode or bond them into a single channel, you will need to do that yourself.
If you make any changes to the switch configuration, be sure to write those changes to memory. We will wipe the switches clean and restore a default
configuration when your experiment ends."""
# Import the Portal object.
import
geni.portal
as
portal
# Import the ProtoGENI library.
import
geni.rspec.pg
as
pg
# Import the Emulab specific extensions.
import
geni.rspec.emulab
as
emulab
# Create a portal context.
pc
=
portal
.
Context
()
# Create a Request object to start building the RSpec.
request
=
pc
.
makeRequestRSpec
()
# Do not run snmpit
#request.skipVlans()
# Add a raw PC to the request and give it an interface.
node1
=
request
.
RawPC
(
"node1"
)
iface1
=
node1
.
addInterface
()
# Specify the IPv4 address
iface1
.
addAddress
(
pg
.
IPv4Address
(
"192.168.1.1"
,
"255.255.255.0"
))
# Add Switch to the request and give it a couple of interfaces
mysw
=
request
.
Switch
(
"mysw"
);
mysw
.
hardware_type
=
"dell-s4048"
swiface1
=
mysw
.
addInterface
()
swiface2
=
mysw
.
addInterface
()
# Add another raw PC to the request and give it an interface.
node2
=
request
.
RawPC
(
"node2"
)
iface2
=
node2
.
addInterface
()
# Specify the IPv4 address
iface2
.
addAddress
(
pg
.
IPv4Address
(
"192.168.1.2"
,
"255.255.255.0"
))
# Add L1 link from node1 to mysw
link1
=
request
.
L1Link
(
"link1"
)
link1
.
addInterface
(
iface1
)
link1
.
addInterface
(
swiface1
)
# Add L1 link from node2 to mysw
link2
=
request
.
L1Link
(
"link2"
)
link2
.
addInterface
(
iface2
)
link2
.
addInterface
(
swiface2
)
# Print the RSpec to the enclosing page.
pc
.
printRequestRSpec
(
request
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment