mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-21 06:09:39 +08:00
fix(region): support managed ipv6 (#19394)
This commit is contained in:
@@ -3657,6 +3657,7 @@ func (self *SGuest) SyncVMNics(
|
||||
_, err = db.Update(&commondb[i], func() error {
|
||||
network := commondb[i].GetNetwork()
|
||||
ip := commonext[i].GetIP()
|
||||
ip6 := commonext[i].GetIP6()
|
||||
if len(ip) > 0 {
|
||||
if !network.Contains(ip) {
|
||||
localNet, err := getCloudNicNetwork(ctx, commonext[i], host, ipList, i)
|
||||
@@ -3667,6 +3668,7 @@ func (self *SGuest) SyncVMNics(
|
||||
commondb[i].IpAddr = ip
|
||||
} else {
|
||||
commondb[i].IpAddr = ip
|
||||
commondb[1].Ip6Addr = ip6
|
||||
}
|
||||
}
|
||||
commondb[i].Driver = commonext[i].GetDriver()
|
||||
@@ -3707,6 +3709,7 @@ func (self *SGuest) SyncVMNics(
|
||||
guestnetworks, err := self.Attach2Network(ctx, userCred, Attach2NetworkArgs{
|
||||
Network: localNet,
|
||||
IpAddr: ip,
|
||||
Ip6Addr: added[i].GetIP6(),
|
||||
NicDriver: added[i].GetDriver(),
|
||||
TryReserved: true,
|
||||
AllocDir: api.IPAllocationDefault,
|
||||
|
||||
@@ -738,6 +738,11 @@ func (snet *SNetwork) SyncWithCloudNetwork(ctx context.Context, userCred mcclien
|
||||
snet.GuestGateway = extNet.GetGateway()
|
||||
snet.ServerType = extNet.GetServerType()
|
||||
|
||||
snet.GuestIp6Start = extNet.GetIp6Start()
|
||||
snet.GuestIp6End = extNet.GetIp6End()
|
||||
snet.GuestIp6Mask = extNet.GetIp6Mask()
|
||||
snet.GuestGateway6 = extNet.GetGateway6()
|
||||
|
||||
snet.AllocTimoutSeconds = extNet.GetAllocTimeoutSeconds()
|
||||
|
||||
if createdAt := extNet.GetCreatedAt(); !createdAt.IsZero() {
|
||||
|
||||
@@ -647,6 +647,7 @@ func (svpc *SVpc) SyncWithCloudVpc(ctx context.Context, userCred mcclient.TokenC
|
||||
}
|
||||
svpc.Status = extVPC.GetStatus()
|
||||
svpc.CidrBlock = extVPC.GetCidrBlock()
|
||||
svpc.CidrBlock6 = extVPC.GetCidrBlock6()
|
||||
svpc.IsDefault = extVPC.GetIsDefault()
|
||||
svpc.ExternalId = extVPC.GetGlobalId()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user