Пример #1
0
 def update_del(self, vIP):
     '''
     This handles the Endpoint Update with the DPS_ENDPOINT_UPDATE_DELETE
     option
     @param vIP: The IP Address of the Endpoint
     @type vIP: IPAddressLocation
     '''
     #Add vIP: Again a needed HACK for mass transfer case
     self.vIP_add(vIP)
     #Mark self type as In Migration State
     self.in_migration = True
     if len(DpsCollection.Endpoint_Expiration_Timer_Queue) < DpsCollection.Max_Endpoint_Timer_Queue_Length:
         #Put on the global expiration timer list
         #Remove from Tunnel since it could be a followed by migration. 
         #But keep a reference to the old tunnel till a new tunnel claims it.
         #Even if the old tunnel is removed this reference will keep the tunnel 
         #object around.
         #THIS IS A HACK that keeps endpoint.tunnel_endpoint a valid entity.
         #Otherwise we would have to have the following checks every
         #if endpoint.tunnel_endpoint != None: <---- TOO MANY PLACES!!!
         TunnelEndpoint.endpoint_del(self.tunnel_endpoint, self)
         DpsCollection.Endpoint_Expiration_Timer_Queue[self] = 3
     else:
         self.delete()
     return
Пример #2
0
 def delete(self):
     '''
     Destructor:
     '''
     if not self.valid:
         return
     self.valid = False
     #Remove from Conflict Detection List
     self.domain.ConflictDetection.endpoint_delete(self)
     #Remove from DPS Client List
     TunnelEndpoint.endpoint_del(self.tunnel_endpoint, self)
     #Remove from Domain Collection
     Domain.endpoint_del(self.domain, self)
     #Remove from VNID/DVG collection
     DVG.endpoint_del(self.dvg, self)
     #Remove vIPs
     self.vIP_set.clear()
     self.vIP_set_show.clear()
     DpsCollection.Endpoints_Count -= 1
     return
Пример #3
0
 def vmotion(self, dvg, vnid, client_type, tunnel_endpoint, transaction_type):
     '''
     This routine handles the scenario where the Endpoint has vmotioned
     (without being explicitly told by the migration source).
     This routine will unlink the Endpoint from the existing DpsClient
     and remove the vIPs
     @param dvg: The DVG Object
     @type dvg: DVG
     @param vnid: The VNID (Maybe different from dvg.unique_id for Domain/DVG 0)
     @type vnid: Integer
     @param client_type: The Type of Client: should be in DpsClientType.types
     @type client_type: Integer 
     @param tunnel_endpoint: The New Tunnel Endpoint on which the endpoint exists
     @type tunnel_endpoint: TunnelEndpoint
     @param transaction_type: The Type of Transaction: should be in DpsTransactionType
     @type transaction_type: Integer
     '''
     #######################################################################
     #Remove from old values
     #######################################################################
     if self.tunnel_endpoint is not None:
         TunnelEndpoint.endpoint_del(self.tunnel_endpoint, self)
         self.tunnel_endpoint = None
     if self.dvg is not None:
         DVG.endpoint_del(self.dvg, self)
         if self.dvg != dvg:
             #Change in VNIDs. Clear all IPs
             DVG.endpoint_del(self.dvg, self)
             self.vIP_delete_all()
             self.vIP_set_show.clear()
     #######################################################################
     #Add to new values
     #######################################################################
     self.dvg = dvg
     self.vnid = vnid
     DVG.endpoint_add(dvg, self)
     self.tunnel_endpoint = tunnel_endpoint
     self.client_type = client_type
     self.in_migration = False
     TunnelEndpoint.endpoint_add(self.tunnel_endpoint, self, transaction_type)
     return