b12751faf02bde3a3c17b59b4a866718eccde01e
2 Distributed Cloud Emulator (dcemulator)
3 (c) 2015 by Manuel Peuster <manuel.peuster@upb.de>
8 DCDPID_BASE
= 1000 # start of switch dpid's used for data center switches
11 class Datacenter(object):
13 Represents a logical data center to which compute resources
14 (Docker containers) can be added at runtime.
17 def __init__(self
, name
):
18 self
.net
= None # DCNetwork to which we belong
20 self
.switch
= None # first prototype assumes one "bigswitch" per DC
22 def _get_next_dc_dpid(self
):
29 Each data center is represented by a single switch to which
30 compute resources can be connected at run time.
32 TODO: This will be changes in the future to support multiple networks
35 self
.switch
= self
.net
.mnet
.addSwitch(
36 "%s.s1" % self
.name
, dpid
=hex(self
._get
_next
_dc
_dpid
())[2:])
37 logging
.debug("created data center switch: %s" % str(self
.switch
))
45 def removeCompute(self
):