Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 76 additions & 0 deletions conf/db/upgrade/V5.5.6__schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,79 @@ CALL CREATE_INDEX('ModelVO', 'idx_modelId', 'modelId');
-- Upgrade existing data: set modelId to uuid if modelId is NULL
-- This UPDATE is idempotent: WHERE clause ensures only NULL values are updated
UPDATE ModelVO SET modelId = uuid WHERE modelId IS NULL;


DELIMITER $$

CREATE PROCEDURE UpdateBareMetal2InstanceProvisionNicVO()
BEGIN
DECLARE instanceUuid_exists INT;
DECLARE isPrimaryProvisionNic_exists_in_ProvisionNicVO INT;
DECLARE isPrimaryProvisionNic_exists_in_ChassisNicVO INT;

DECLARE EXIT HANDLER FOR SQLEXCEPTION
BEGIN
ROLLBACK;
SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = 'An error occurred during the update process.';
END;

START TRANSACTION;

SELECT COUNT(*)
INTO instanceUuid_exists
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_SCHEMA = 'zstack'
AND TABLE_NAME = 'BareMetal2InstanceProvisionNicVO'
AND COLUMN_NAME = 'instanceUuid';

IF instanceUuid_exists = 0 THEN
CALL ADD_COLUMN('BareMetal2InstanceProvisionNicVO', 'instanceUuid', 'VARCHAR(32)', FALSE, '');

UPDATE `zstack`.`BareMetal2InstanceProvisionNicVO`
SET `instanceUuid` = `uuid`;

ALTER TABLE `zstack`.`BareMetal2InstanceProvisionNicVO`
DROP FOREIGN KEY `fkBareMetal2InstanceProvisionNicVOInstanceVO`;

CALL ADD_CONSTRAINT('BareMetal2InstanceProvisionNicVO', 'fkBareMetal2InstanceProvisionNicVOInstanceVO',
'instanceUuid', 'BareMetal2InstanceVO', 'uuid', 'CASCADE');

UPDATE `zstack`.`BareMetal2InstanceProvisionNicVO`
SET `uuid` = REPLACE(UUID(), '-', '');
END IF;
Comment on lines +54 to +56
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

# Search for references to BareMetal2InstanceProvisionNicVO in SQL files
rg -n "BareMetal2InstanceProvisionNicVO" -g '*.sql' conf/db

Repository: MatheMatrix/zstack

Length of output: 2303


🏁 Script executed:

# Search for foreign key references to this table
rg -n "REFERENCES\s+\`?BareMetal2InstanceProvisionNicVO\`?" -g '*.sql' conf/db

Repository: MatheMatrix/zstack

Length of output: 44


🏁 Script executed:

# Also search in Java files for references to this VO class
rg -n "BareMetal2InstanceProvisionNicVO" -g '*.java' --type java

Repository: MatheMatrix/zstack

Length of output: 44


🏁 Script executed:

# Check the full context of the V5.5.6__schema.sql file to understand the migration purpose
cat -n conf/db/upgrade/V5.5.6__schema.sql | head -80

Repository: MatheMatrix/zstack

Length of output: 3833


🏁 Script executed:

# Search for handling of BareMetal2BondingNicRefVO in the migration script
rg -n "BareMetal2BondingNicRefVO" conf/db/upgrade/V5.5.6__schema.sql

Repository: MatheMatrix/zstack

Length of output: 44


🏁 Script executed:

# Check if there's any CASCADE DELETE or UPDATE handling in the script
rg -n "CASCADE|UPDATE.*provisionNicUuid" conf/db/upgrade/V5.5.6__schema.sql

Repository: MatheMatrix/zstack

Length of output: 160


🏁 Script executed:

# Get the full migration script to see all procedures and logic
wc -l conf/db/upgrade/V5.5.6__schema.sql

Repository: MatheMatrix/zstack

Length of output: 99


🏁 Script executed:

# Get the complete migration script to see all content
cat -n conf/db/upgrade/V5.5.6__schema.sql

Repository: MatheMatrix/zstack

Length of output: 4205


🏁 Script executed:

# Check what the original FK constraint definition looks like
rg -B2 -A2 "fkBareMetal2BondingNicRefVOProvisionNicVO" conf/db/upgrade/V4.7.13__schema.sql

Repository: MatheMatrix/zstack

Length of output: 418


🏁 Script executed:

# Check if BareMetal2BondingNicRefVO.fkBareMetal2BondingNicRefVOProvisionNicVO is modified or dropped before/after the uuid update
rg -B5 -A5 "BareMetal2BondingNicRefVO" conf/db/upgrade/V5.5.6__schema.sql

Repository: MatheMatrix/zstack

Length of output: 44


🏁 Script executed:

# Check the full definition of ADD_CONSTRAINT to understand what CASCADE means
rg -B3 -A10 "PROCEDURE ADD_CONSTRAINT" conf/db/

Repository: MatheMatrix/zstack

Length of output: 44


🏁 Script executed:

# Check if there's any logic in beforeMigrate or related files that might handle cascade updates
find conf/db/upgrade -name "*.sql" | head -20

Repository: MatheMatrix/zstack

Length of output: 737


🏁 Script executed:

# Search for any UPDATE statements that might update provisionNicUuid
rg -n "provisionNicUuid" conf/db/upgrade/

Repository: MatheMatrix/zstack

Length of output: 399


🏁 Script executed:

# Check the detailed FK constraint configuration in the database schema files
rg -B2 -A2 "ON DELETE CASCADE|ON UPDATE CASCADE" conf/db/upgrade/V4.7.13__schema.sql

Repository: MatheMatrix/zstack

Length of output: 519


🏁 Script executed:

# Search for any Java code that references BareMetal2BondingNicRefVO to understand business logic
find . -name "*.java" -type f | xargs grep -l "BareMetal2BondingNicRefVO" 2>/dev/null | head -5

Repository: MatheMatrix/zstack

Length of output: 44


🏁 Script executed:

# Check if the ADD_CONSTRAINT procedure call shows ON UPDATE CASCADE or ON UPDATE RESTRICT
rg -B5 -A5 "fkBareMetal2BondingNicRefVOProvisionNicVO" conf/db/upgrade/V4.7.13__schema.sql

Repository: MatheMatrix/zstack

Length of output: 593


🏁 Script executed:

# Check procedure definition for ADD_CONSTRAINT to see default behavior
find conf/db -name "*.sql" | xargs grep -l "PROCEDURE ADD_CONSTRAINT" 2>/dev/null

Repository: MatheMatrix/zstack

Length of output: 46


🏁 Script executed:

# Check if there's a beforeMigrate.sql or similar that might have the ADD_CONSTRAINT procedure definition
find conf/db -name "beforeMigrate.sql" -o -name "*.sql" | xargs grep -l "PROCEDURE ADD_CONSTRAINT" 2>/dev/null | head -3

Repository: MatheMatrix/zstack

Length of output: 44


🏁 Script executed:

# Look for the ADD_CONSTRAINT procedure definition more carefully
find conf -name "*.sql" -type f -exec grep -l "CREATE PROCEDURE ADD_CONSTRAINT" {} \;

Repository: MatheMatrix/zstack

Length of output: 44


🏁 Script executed:

# Check if there are any statements that drop or disable constraints before the uuid update in V5.5.6
sed -n '40,60p' conf/db/upgrade/V5.5.6__schema.sql

Repository: MatheMatrix/zstack

Length of output: 929


🏁 Script executed:

# Check if there's any migration that explicitly updates BareMetal2BondingNicRefVO.provisionNicUuid after V4.7.13
rg -A10 "UpdateBareMetal2InstanceProvisionNicVO" conf/db/upgrade/V5.5.6__schema.sql | head -50

Repository: MatheMatrix/zstack

Length of output: 582


🏁 Script executed:

# Search for any Java migration or liquibase handlers that might update BareMetal2BondingNicRefVO
find . -name "*.java" -type f | xargs grep -l "BareMetal2BondingNicRefVO\|BareMetal2InstanceProvisionNicVO" 2>/dev/null | grep -i migrat | head -5

Repository: MatheMatrix/zstack

Length of output: 44


🏁 Script executed:

# Double-check if BareMetal2BondingNicRefVO exists and has data
rg -n "BareMetal2BondingNicRefVO" conf/db/upgrade/V5.5.6__schema.sql

Repository: MatheMatrix/zstack

Length of output: 44


🏁 Script executed:

# Check the ADD_CONSTRAINT procedure to understand what 'CASCADE' parameter means
find conf/db -name "*.sql" -type f | xargs grep -B5 -A15 "procedure.*ADD_CONSTRAINT" -i 2>/dev/null | head -60

Repository: MatheMatrix/zstack

Length of output: 1630


🏁 Script executed:

# Look for beforeMigrate.sql which likely has the procedure definitions
cat conf/db/upgrade/beforeMigrate.sql 2>/dev/null | grep -A20 "ADD_CONSTRAINT"

Repository: MatheMatrix/zstack

Length of output: 1067


🏁 Script executed:

# Check if the migration has disabled foreign key checks
grep -n "FOREIGN_KEY_CHECKS\|DISABLE\|ENABLE" conf/db/upgrade/V5.5.6__schema.sql

Repository: MatheMatrix/zstack

Length of output: 44


🏁 Script executed:

# Get the complete beforeMigrate.sql to check if it disables foreign key checks
cat conf/db/upgrade/beforeMigrate.sql | grep -i "FOREIGN_KEY_CHECKS\|SET SESSION"

Repository: MatheMatrix/zstack

Length of output: 89


🏁 Script executed:

# Look for any migration script wrapper or main migration runner that might disable FK checks
find conf/db -name "*.sql" -type f | xargs grep -l "FOREIGN_KEY_CHECKS" 2>/dev/null

Repository: MatheMatrix/zstack

Length of output: 557


🏁 Script executed:

# Check if there's a CREATE TABLE or ALTER TABLE for BareMetal2BondingNicRefVO that might indicate if this table has data
rg -B2 -A10 "CREATE TABLE.*BareMetal2BondingNicRefVO" conf/db/upgrade/

Repository: MatheMatrix/zstack

Length of output: 1073


🏁 Script executed:

# Check if there's logic to update BareMetal2BondingNicRefVO.provisionNicUuid somewhere
# Search in the procedure for any UPDATE that handles the cascading change
sed -n '21,90p' conf/db/upgrade/V5.5.6__schema.sql | grep -i "UPDATE\|provisionNicUuid"

Repository: MatheMatrix/zstack

Length of output: 444


🏁 Script executed:

# Check the structure of BareMetal2BondingNicRefVO to see if it will have data
cat conf/db/upgrade/V4.4.24__schema.sql | grep -A20 "CREATE TABLE.*BareMetal2BondingNicRefVO"

Repository: MatheMatrix/zstack

Length of output: 1325


🏁 Script executed:

# Check if there's any post-migration script or idempotent check that fixes referential integrity
find conf/db -name "*.sql" | xargs grep -l "provisionNicUuid\|BareMetal2BondingNicRefVO" | xargs grep -l "UPDATE" | head -5

Repository: MatheMatrix/zstack

Length of output: 133


🏁 Script executed:

# Verify the exact FK constraint definition created in V4.7.13 to see if it has ON UPDATE CASCADE
cat conf/db/upgrade/V4.7.13__schema.sql | grep -B5 -A5 "fkBareMetal2BondingNicRefVOProvisionNicVO"

Repository: MatheMatrix/zstack

Length of output: 593


🏁 Script executed:

# Check if the migration re-enables FOREIGN_KEY_CHECKS after the procedure
tail -20 conf/db/upgrade/beforeMigrate.sql

Repository: MatheMatrix/zstack

Length of output: 602


🏁 Script executed:

# Check the exact FK constraint that was created - does it have ON UPDATE CASCADE?
# Let's see what the ADD_CONSTRAINT procedure actually creates in SQL
cat conf/db/upgrade/beforeMigrate.sql | sed -n '/CREATE PROCEDURE.*ADD_CONSTRAINT/,/END\$\$/p' | head -30

Repository: MatheMatrix/zstack

Length of output: 1088


🏁 Script executed:

# Verify if there's any UPDATE statement that handles the propagation to BareMetal2BondingNicRefVO
grep -n "provisionNicUuid\|UPDATE.*BareMetal2BondingNicRefVO" conf/db/upgrade/V5.5.6__schema.sql

Repository: MatheMatrix/zstack

Length of output: 44


🏁 Script executed:

# Check what happens after the procedure - is there any update to BareMetal2BondingNicRefVO?
cat conf/db/upgrade/V5.5.6__schema.sql | tail -20

Repository: MatheMatrix/zstack

Length of output: 753


🏁 Script executed:

# Check if afterMigrate.sql re-enables FOREIGN_KEY_CHECKS and if there's any cleanup
cat conf/db/upgrade/afterMigrate.sql 2>/dev/null | head -20

Repository: MatheMatrix/zstack

Length of output: 44


🏁 Script executed:

# Verify: does the ADD_CONSTRAINT with 'CASCADE' parameter only handle ON DELETE or also ON UPDATE?
# The procedure we saw only uses ON DELETE, so CASCADE means ON DELETE CASCADE, not ON UPDATE CASCADE
# Let's confirm by checking the exact SQL it generates
grep -A5 "ON DELETE" conf/db/upgrade/beforeMigrate.sql | head -10

Repository: MatheMatrix/zstack

Length of output: 277


🏁 Script executed:

# Let's create a summary by checking: does the migration explicitly handle the cascade update?
# Check the entire V5.5.6 migration to see if there's any update to BareMetal2BondingNicRefVO
cat conf/db/upgrade/V5.5.6__schema.sql | grep -i "BareMetal2Bonding"

Repository: MatheMatrix/zstack

Length of output: 44


🏁 Script executed:

# Verify the FK constraint definition one more time - confirm it's only ON DELETE CASCADE
cat conf/db/upgrade/V4.7.13__schema.sql | tail -10

Repository: MatheMatrix/zstack

Length of output: 715


🏁 Script executed:

# Check if afterMigrate.sql re-enables FOREIGN_KEY_CHECKS
cat conf/db/upgrade/afterMigrate.sql 2>/dev/null

Repository: MatheMatrix/zstack

Length of output: 44


在 UUID 全量更新前,必须同步更新 BareMetal2BondingNicRefVO.provisionNicUuid

BareMetal2InstanceProvisionNicVO.uuid 被外表 BareMetal2BondingNicRefVO 的外键约束 fkBareMetal2BondingNicRefVOProvisionNicVO 引用。当直接更新 uuid 为新值时,该外键约束(ON DELETE CASCADE,不包含 ON UPDATE CASCADE)不会自动更新关联的 provisionNicUuid,导致 FK 完整性失效。

需要在 UPDATE uuid 语句(第 54-55 行)之前或之后,显式添加逻辑更新 BareMetal2BondingNicRefVO.provisionNicUuid 中的对应值,以维持引用一致性。例如:

UPDATE `zstack`.`BareMetal2BondingNicRefVO` as ref
INNER JOIN `zstack`.`BareMetal2InstanceProvisionNicVO` as prov
SET ref.provisionNicUuid = prov.uuid
WHERE ref.provisionNicUuid = prov.<old_uuid_value>
🤖 Prompt for AI Agents
In `@conf/db/upgrade/V5.5.6__schema.sql` around lines 54 - 56, Before changing
BareMetal2InstanceProvisionNicVO.uuid, update the referencing column
BareMetal2BondingNicRefVO.provisionNicUuid to the new UUIDs to preserve FK
consistency: for each row being modified in BareMetal2InstanceProvisionNicVO
(uuid), perform an UPDATE of BareMetal2BondingNicRefVO using an INNER JOIN to
match the old uuid and set provisionNicUuid to the new generated uuid; do this
inside the same transaction and alongside the UPDATE of
BareMetal2InstanceProvisionNicVO.uuid to ensure atomicity and avoid FK breakage
(refer to BareMetal2InstanceProvisionNicVO.uuid,
BareMetal2BondingNicRefVO.provisionNicUuid and the
fkBareMetal2BondingNicRefVOProvisionNicVO constraint).


SELECT COUNT(*)
INTO isPrimaryProvisionNic_exists_in_ProvisionNicVO
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_SCHEMA = 'zstack'
AND TABLE_NAME = 'BareMetal2InstanceProvisionNicVO'
AND COLUMN_NAME = 'isPrimaryProvisionNic';

IF isPrimaryProvisionNic_exists_in_ProvisionNicVO = 0 THEN
CALL ADD_COLUMN('BareMetal2InstanceProvisionNicVO', 'isPrimaryProvisionNic', 'BOOLEAN', FALSE, FALSE);

UPDATE `zstack`.`BareMetal2InstanceProvisionNicVO`
SET `isPrimaryProvisionNic` = TRUE;
END IF;

SELECT COUNT(*)
INTO isPrimaryProvisionNic_exists_in_ChassisNicVO
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_SCHEMA = 'zstack'
AND TABLE_NAME = 'BareMetal2ChassisNicVO'
AND COLUMN_NAME = 'isPrimaryProvisionNic';

IF isPrimaryProvisionNic_exists_in_ChassisNicVO = 0 THEN
CALL ADD_COLUMN('BareMetal2ChassisNicVO', 'isPrimaryProvisionNic', 'BOOLEAN', FALSE, FALSE);

UPDATE `zstack`.`BareMetal2ChassisNicVO`
SET `isPrimaryProvisionNic` = TRUE
WHERE `isProvisionNic` = TRUE;
END IF;

COMMIT;
END$$

DELIMITER ;
CALL UpdateBareMetal2InstanceProvisionNicVO();
DROP PROCEDURE IF EXISTS UpdateBareMetal2InstanceProvisionNicVO;
Comment on lines +19 to +92
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

find . -name "V5.5.6__schema.sql" -type f

Repository: MatheMatrix/zstack

Length of output: 98


🏁 Script executed:

find . -path "*/db/upgrade/*.sql" -type f | head -20

Repository: MatheMatrix/zstack

Length of output: 777


🏁 Script executed:

rg -l "ADD_COLUMN|ADD_CONSTRAINT" --type sql

Repository: MatheMatrix/zstack

Length of output: 662


🏁 Script executed:

cat -n ./conf/db/upgrade/V5.5.6__schema.sql | head -100

Repository: MatheMatrix/zstack

Length of output: 3734


🏁 Script executed:

rg -A 20 "CREATE PROCEDURE ADD_COLUMN" --type sql

Repository: MatheMatrix/zstack

Length of output: 44


🏁 Script executed:

rg -A 20 "CREATE PROCEDURE ADD_CONSTRAINT" --type sql

Repository: MatheMatrix/zstack

Length of output: 44


🏁 Script executed:

rg "CREATE PROCEDURE \`?ADD_COLUMN\`?" --type sql -A 5

Repository: MatheMatrix/zstack

Length of output: 445


🏁 Script executed:

rg "DROP PROCEDURE IF EXISTS" ./conf/db/upgrade/V5.5.6__schema.sql

Repository: MatheMatrix/zstack

Length of output: 126


🏁 Script executed:

rg -B 5 -A 5 "DROP FOREIGN KEY" ./conf/db/upgrade/V5.5.6__schema.sql

Repository: MatheMatrix/zstack

Length of output: 565


🏁 Script executed:

rg -B 5 -A 10 "DROP FOREIGN KEY" ./conf/db/upgrade/*.sql | head -100

Repository: MatheMatrix/zstack

Length of output: 9340


升级脚本需添加过程防护与外键删除存在性检查

过程的创建前缺少 DROP PROCEDURE IF EXISTS。若升级过程中抛错未执行到末尾的 DROP PROCEDURE,二次执行会因为同名存储过程已存在而失败。同时第39-40行 DROP FOREIGN KEY 在约束不存在时会直接报错中断升级。建议在 CREATE PROCEDURE 前添加 DROP PROCEDURE IF EXISTS,并在删外键前通过 INFORMATION_SCHEMA.TABLE_CONSTRAINTS 判断约束存在性。

建议修改
-DELIMITER $$
+DELIMITER $$
+DROP PROCEDURE IF EXISTS UpdateBareMetal2InstanceProvisionNicVO$$
 CREATE PROCEDURE UpdateBareMetal2InstanceProvisionNicVO()
 BEGIN
     DECLARE instanceUuid_exists INT;
+    DECLARE fk_bm2_provisionnic_instancevo_exists INT;
     DECLARE isPrimaryProvisionNic_exists_in_ProvisionNicVO INT;
     DECLARE isPrimaryProvisionNic_exists_in_ChassisNicVO INT;
-        ALTER TABLE `zstack`.`BareMetal2InstanceProvisionNicVO`
-        DROP FOREIGN KEY `fkBareMetal2InstanceProvisionNicVOInstanceVO`;
+        SELECT COUNT(*)
+            INTO fk_bm2_provisionnic_instancevo_exists
+            FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS
+            WHERE TABLE_SCHEMA = 'zstack'
+              AND TABLE_NAME = 'BareMetal2InstanceProvisionNicVO'
+              AND CONSTRAINT_NAME = 'fkBareMetal2InstanceProvisionNicVOInstanceVO'
+              AND CONSTRAINT_TYPE = 'FOREIGN KEY';
+
+        IF fk_bm2_provisionnic_instancevo_exists > 0 THEN
+            ALTER TABLE `zstack`.`BareMetal2InstanceProvisionNicVO`
+            DROP FOREIGN KEY `fkBareMetal2InstanceProvisionNicVOInstanceVO`;
+        END IF;
🤖 Prompt for AI Agents
In `@conf/db/upgrade/V5.5.6__schema.sql` around lines 10 - 83, Add a guard to
avoid re-creating the stored procedure and to avoid dropping a non-existent FK:
insert DROP PROCEDURE IF EXISTS UpdateBareMetal2InstanceProvisionNicVO; before
CREATE PROCEDURE UpdateBareMetal2InstanceProvisionNicVO(), and replace the
unconditional ALTER TABLE ... DROP FOREIGN KEY
`fkBareMetal2InstanceProvisionNicVOInstanceVO` on table
`BareMetal2InstanceProvisionNicVO` with a check against
INFORMATION_SCHEMA.TABLE_CONSTRAINTS (or KEY_COLUMN_USAGE) for constraint_name =
'fkBareMetal2InstanceProvisionNicVOInstanceVO' and only execute the DROP FOREIGN
KEY when that check shows the constraint exists; keep all work inside the same
transaction and leave the final DROP PROCEDURE IF EXISTS
UpdateBareMetal2InstanceProvisionNicVO as-is.

Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,12 @@
import org.zstack.header.storage.primary.*;
import org.zstack.header.storage.primary.VolumeSnapshotCapability.VolumeSnapshotArrangementType;
import org.zstack.header.storage.snapshot.*;
import org.zstack.header.tag.SystemTagVO;
import org.zstack.header.tag.SystemTagVO_;
import org.zstack.header.vm.VmInstanceSpec;
import org.zstack.header.vm.VmInstanceSpec.ImageSpec;
import org.zstack.header.vm.VmInstanceVO;
import org.zstack.header.vm.VmInstanceVO_;
import org.zstack.header.vo.ResourceVO;
import org.zstack.header.volume.*;
import org.zstack.identity.AccountManager;
Expand Down Expand Up @@ -485,6 +489,8 @@ public static class CloneRsp extends AgentResponse {
public Long size;
public Long actualSize;
public String installPath;
public String volumeId;
public String volumeStatus;

public String getInstallPath() {
return installPath;
Expand All @@ -493,6 +499,22 @@ public String getInstallPath() {
public void setInstallPath(String installPath) {
this.installPath = installPath;
}

public String getVolumeId() {
return volumeId;
}

public void setVolumeId(String volumeId) {
this.volumeId = volumeId;
}

public String getVolumeStatus() {
return volumeStatus;
}

public void setVolumeStatus(String volumeStatus) {
this.volumeStatus = volumeStatus;
}
}

public static class FlattenCmd extends AgentCommand implements HasThreadContext {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,14 @@ public java.lang.Boolean getIsProvisionNic() {
return this.isProvisionNic;
}

public java.lang.Boolean isPrimaryProvisionNic;
public void setIsPrimaryProvisionNic(java.lang.Boolean isPrimaryProvisionNic) {
this.isPrimaryProvisionNic = isPrimaryProvisionNic;
}
public java.lang.Boolean getIsPrimaryProvisionNic() {
return this.isPrimaryProvisionNic;
}

public java.sql.Timestamp createDate;
public void setCreateDate(java.sql.Timestamp createDate) {
this.createDate = createDate;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.zstack.sdk;

import org.zstack.sdk.BareMetal2InstanceProvisionNicInventory;


public class BareMetal2InstanceInventory extends org.zstack.sdk.VmInstanceInventory {

Expand Down Expand Up @@ -84,12 +84,12 @@ public boolean getIsLatestAgent() {
return this.isLatestAgent;
}

public BareMetal2InstanceProvisionNicInventory provisionNic;
public void setProvisionNic(BareMetal2InstanceProvisionNicInventory provisionNic) {
this.provisionNic = provisionNic;
public java.util.List provisionNics;
public void setProvisionNics(java.util.List provisionNics) {
this.provisionNics = provisionNics;
}
public BareMetal2InstanceProvisionNicInventory getProvisionNic() {
return this.provisionNic;
public java.util.List getProvisionNics() {
return this.provisionNics;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,22 @@ public java.lang.String getGateway() {
return this.gateway;
}

public java.lang.String instanceUuid;
public void setInstanceUuid(java.lang.String instanceUuid) {
this.instanceUuid = instanceUuid;
}
public java.lang.String getInstanceUuid() {
return this.instanceUuid;
}

public java.lang.Boolean isPrimaryProvisionNic;
public void setIsPrimaryProvisionNic(java.lang.Boolean isPrimaryProvisionNic) {
this.isPrimaryProvisionNic = isPrimaryProvisionNic;
}
public java.lang.Boolean getIsPrimaryProvisionNic() {
return this.isPrimaryProvisionNic;
}

public java.lang.String metadata;
public void setMetadata(java.lang.String metadata) {
this.metadata = metadata;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -700,6 +700,8 @@ public class CloudOperationsErrorCode {

public static final String ORG_ZSTACK_STORAGE_VOLUME_BLOCK_10002 = "ORG_ZSTACK_STORAGE_VOLUME_BLOCK_10002";

public static final String ORG_ZSTACK_STORAGE_VOLUME_BLOCK_10003 = "ORG_ZSTACK_STORAGE_VOLUME_BLOCK_10003";

public static final String ORG_ZSTACK_ALIYUN_CORE_10000 = "ORG_ZSTACK_ALIYUN_CORE_10000";

public static final String ORG_ZSTACK_ALIYUN_CORE_10001 = "ORG_ZSTACK_ALIYUN_CORE_10001";
Expand Down Expand Up @@ -7678,6 +7680,10 @@ public class CloudOperationsErrorCode {

public static final String ORG_ZSTACK_BAREMETAL2_INSTANCE_10087 = "ORG_ZSTACK_BAREMETAL2_INSTANCE_10087";

public static final String ORG_ZSTACK_BAREMETAL2_INSTANCE_10088 = "ORG_ZSTACK_BAREMETAL2_INSTANCE_10088";

public static final String ORG_ZSTACK_BAREMETAL2_INSTANCE_10089 = "ORG_ZSTACK_BAREMETAL2_INSTANCE_10089";

public static final String ORG_ZSTACK_CRYPTO_SECURITYMACHINE_SECRETRESOURCEPOOL_10000 = "ORG_ZSTACK_CRYPTO_SECURITYMACHINE_SECRETRESOURCEPOOL_10000";

public static final String ORG_ZSTACK_CRYPTO_SECURITYMACHINE_SECRETRESOURCEPOOL_10001 = "ORG_ZSTACK_CRYPTO_SECURITYMACHINE_SECRETRESOURCEPOOL_10001";
Expand Down Expand Up @@ -12824,6 +12830,8 @@ public class CloudOperationsErrorCode {

public static final String ORG_ZSTACK_STORAGE_CEPH_PRIMARY_10052 = "ORG_ZSTACK_STORAGE_CEPH_PRIMARY_10052";

public static final String ORG_ZSTACK_STORAGE_CEPH_PRIMARY_10053 = "ORG_ZSTACK_STORAGE_CEPH_PRIMARY_10053";

public static final String ORG_ZSTACK_EXTERNALSERVICE_CRONJOB_10000 = "ORG_ZSTACK_EXTERNALSERVICE_CRONJOB_10000";

public static final String ORG_ZSTACK_EXTERNALSERVICE_CRONJOB_10001 = "ORG_ZSTACK_EXTERNALSERVICE_CRONJOB_10001";
Expand Down Expand Up @@ -13706,6 +13714,10 @@ public class CloudOperationsErrorCode {

public static final String ORG_ZSTACK_BAREMETAL2_CHASSIS_10023 = "ORG_ZSTACK_BAREMETAL2_CHASSIS_10023";

public static final String ORG_ZSTACK_BAREMETAL2_CHASSIS_10024 = "ORG_ZSTACK_BAREMETAL2_CHASSIS_10024";

public static final String ORG_ZSTACK_BAREMETAL2_CHASSIS_10025 = "ORG_ZSTACK_BAREMETAL2_CHASSIS_10025";

public static final String ORG_ZSTACK_BAREMETAL2_CLUSTER_10000 = "ORG_ZSTACK_BAREMETAL2_CLUSTER_10000";

public static final String ORG_ZSTACK_BAREMETAL2_CLUSTER_10001 = "ORG_ZSTACK_BAREMETAL2_CLUSTER_10001";
Expand Down