Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
RECIRCLE
/
interface-openstack
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
2
Merge Requests
4
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
f998eb34
authored
May 13, 2019
by
edems
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Network test
parent
7696614a
Pipeline
#714
failed with stage
in 37 seconds
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
5 deletions
+18
-5
main.py
+18
-5
No files found.
main.py
View file @
f998eb34
...
...
@@ -16,6 +16,19 @@ subnet_manager = OpenstackSubnetManager(os)
port_manager
=
OpenstackPortManager
(
os
)
floating_ip_manager
=
OpenstackFloatingIPManager
(
os
)
'''
Network setup steps:
- Create inner network
- Create subnet for inner network
- Create router
- Add public network to router as gateway
- Add inner subnet to router as interface
- Add interface (or port?) to vm
- Get the port of the vm
- Create floating ip to public network
- Associate floating ip and vm port
'''
#router = router_manager.create()
router
=
router_manager
.
get
(
'3ee87bcd-b1b5-4e14-86a1-ce691bd3e5a2'
)
...
...
@@ -24,7 +37,7 @@ print('\t%s' % router)
#network = network_manager.create()
public_network
=
network_manager
.
get
(
'3b349c93-8b2c-4abd-b8ce-22b7db4cca98'
)
inner_network
=
network_manager
.
get
(
'
ac15d5e2-f32e-4ea3-9fa5-345d3e147aa5
'
)
inner_network
=
network_manager
.
get
(
'
8df0d7ab-7d56-4496-aca0-317af66b3ebc
'
)
print
(
'Network:'
)
print
(
'
\t
Public:
%
s'
%
public_network
)
...
...
@@ -32,25 +45,25 @@ print('\tInner: %s' % inner_network)
#subnet = subnet_manager.create(network.id, 4, '10.34.0.0/16')
public_subnet
=
subnet_manager
.
get
(
'8a7e05f8-6358-48f7-9104-990d350425a0'
)
inner_subnet
=
subnet_manager
.
get
(
'
b7650962-4323-475c-9ee6-08d64e2c8577
'
)
inner_subnet
=
subnet_manager
.
get
(
'
34911571-c929-4433-b4e6-305fcb585a91'
)
#create(inner_network.id, 4, '10.0.0.0/24
')
print
(
'Subnet:'
)
print
(
'
\t
Public:
%
s'
%
public_subnet
)
print
(
'
\t
Inner:
%
s'
%
inner_subnet
)
vm_port
=
port_manager
.
get
(
'
bd1f0753-613d-4ecf-8605-eacc3ca63373
'
)
# inner
vm_port
=
port_manager
.
get
(
'
85202d6d-7aa0-44bc-a5eb-78b0519066c5
'
)
# inner
print
(
'Port:'
)
print
(
'
\t
VM:
%
s'
%
vm_port
)
#floating_ip = floating_ip_manager.create(public_network.id)
floating_ip
=
floating_ip_manager
.
get
(
'
df353eb0-9f0b-4bee-9492-148e29873450
'
)
floating_ip
=
floating_ip_manager
.
get
(
'
fe1e329f-aedb-4b3e-a649-9fec8eb3ece5
'
)
print
(
'Floating IP:'
)
print
(
'
\t
Floating IP:
%
s'
%
floating_ip
)
#print(router_manager.add_interface(router.id,
subnet.id))
#print(router_manager.add_interface(router.id,
inner_subnet.id)) # TODO: fix error msg
#print(router_manager.add_gateway(router.id, public_network.id)) # TODO: fix it!
# print(floating_ip_manager.update(floating_ip.id, {
...
...
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