Skip to content

Commit

Permalink
feat: register esxi vtap support cloudtower
Browse files Browse the repository at this point in the history
  • Loading branch information
askyrie authored and SongZhen0704 committed Dec 5, 2024
1 parent 69bb43a commit 4022fd2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion server/controller/recorder/domain.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ func (d *domain) tryRefresh(cloudData cloudmodel.Resource) error {

func (d *domain) shouldRefresh(cloudData cloudmodel.Resource) error {
if cloudData.Verified {
if len(cloudData.Networks) == 0 || len(cloudData.VInterfaces) == 0 {
if (d.metadata.Domain.Type != common.CLOUD_TOWER && len(cloudData.Networks) == 0) || len(cloudData.VInterfaces) == 0 {
log.Info(d.metadata.Logf("domain has no networks or vinterfaces, does nothing"))
return DataMissingError
}
Expand Down
10 changes: 9 additions & 1 deletion server/controller/trisolaris/vtap/vtap_discovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -606,9 +606,17 @@ func (l *VTapLKData) LookUpMirrorVTapByIP(db *gorm.DB) *VTapLKResult {
return nil
}

var domainType int
domain, err := dbmgr.DBMgr[models.Domain](db).GetFromLcuuid(host.Domain)
if err != nil {
log.Warning(l.Logf("host(%s) domain(%s) not found", host.Name, host.Domain))
} else {
domainType = domain.Type
}

var vTapName, launchServer, az, region, lcuuid string
var vTapType, launchServerID int
if host.HType == HOST_HTYPE_ESXI {
if host.HType == HOST_HTYPE_ESXI || domainType == CLOUD_TOWER {
vTapName = fmt.Sprintf("%s-H%d", host.Name, host.ID)
vTapType = VTAP_TYPE_ESXI
launchServer = host.IP
Expand Down

0 comments on commit 4022fd2

Please sign in to comment.