bug 9391: removed source_id, source_type from "volumes" table as we don't use them any more

status 9391: resolved fixed

Conflicts:

	server/src/com/cloud/network/NetworkManagerImpl.java
This commit is contained in:
alena 2011-04-11 18:19:10 -07:00
parent 52bf157387
commit acaab55c3e
8 changed files with 476 additions and 479 deletions

View File

@ -24,113 +24,135 @@ import com.cloud.serializer.Param;
import com.google.gson.annotations.SerializedName;
public class VolumeResponse extends BaseResponse {
@SerializedName(ApiConstants.ID) @Param(description="ID of the disk volume")
@SerializedName(ApiConstants.ID)
@Param(description = "ID of the disk volume")
private Long id;
@SerializedName(ApiConstants.JOB_ID) @Param(description="shows the current pending asynchronous job ID. This tag is not returned if no current pending jobs are acting on the volume")
@SerializedName(ApiConstants.JOB_ID)
@Param(description = "shows the current pending asynchronous job ID. This tag is not returned if no current pending jobs are acting on the volume")
private Long jobId;
@SerializedName("jobstatus") @Param(description="shows the current pending asynchronous job status")
@SerializedName("jobstatus")
@Param(description = "shows the current pending asynchronous job status")
private Integer jobStatus;
@SerializedName(ApiConstants.NAME) @Param(description="name of the disk volume")
@SerializedName(ApiConstants.NAME)
@Param(description = "name of the disk volume")
private String name;
@SerializedName(ApiConstants.ZONE_ID) @Param(description="ID of the availability zone")
@SerializedName(ApiConstants.ZONE_ID)
@Param(description = "ID of the availability zone")
private Long zoneId;
@SerializedName("zonename") @Param(description="name of the availability zone")
@SerializedName("zonename")
@Param(description = "name of the availability zone")
private String zoneName;
@SerializedName(ApiConstants.TYPE) @Param(description="type of the disk volume (ROOT or DATADISK)")
@SerializedName(ApiConstants.TYPE)
@Param(description = "type of the disk volume (ROOT or DATADISK)")
private String volumeType;
@SerializedName(ApiConstants.DEVICE_ID) @Param(description="the ID of the device on user vm the volume is attahed to. This tag is not returned when the volume is detached.")
@SerializedName(ApiConstants.DEVICE_ID)
@Param(description = "the ID of the device on user vm the volume is attahed to. This tag is not returned when the volume is detached.")
private Long deviceId;
@SerializedName(ApiConstants.VIRTUAL_MACHINE_ID) @Param(description="id of the virtual machine")
@SerializedName(ApiConstants.VIRTUAL_MACHINE_ID)
@Param(description = "id of the virtual machine")
private Long virtualMachineId;
@SerializedName("vmname") @Param(description="name of the virtual machine")
@SerializedName("vmname")
@Param(description = "name of the virtual machine")
private String virtualMachineName;
@SerializedName("vmdisplayname") @Param(description="display name of the virtual machine")
@SerializedName("vmdisplayname")
@Param(description = "display name of the virtual machine")
private String virtualMachineDisplayName;
@SerializedName("vmstate") @Param(description="state of the virtual machine")
@SerializedName("vmstate")
@Param(description = "state of the virtual machine")
private String virtualMachineState;
@SerializedName(ApiConstants.SIZE) @Param(description="size of the disk volume")
@SerializedName(ApiConstants.SIZE)
@Param(description = "size of the disk volume")
private Long size;
@SerializedName(ApiConstants.CREATED) @Param(description="the date the disk volume was created")
@SerializedName(ApiConstants.CREATED)
@Param(description = "the date the disk volume was created")
private Date created;
@SerializedName(ApiConstants.STATE) @Param(description="the state of the disk volume")
@SerializedName(ApiConstants.STATE)
@Param(description = "the state of the disk volume")
private String state;
@SerializedName(ApiConstants.STATUS) @Param(description="the status of the disk volume")
private String status;
@SerializedName(ApiConstants.ACCOUNT) @Param(description="the account associated with the disk volume")
@SerializedName(ApiConstants.ACCOUNT)
@Param(description = "the account associated with the disk volume")
private String accountName;
@SerializedName(ApiConstants.DOMAIN_ID) @Param(description="the ID of the domain associated with the disk volume")
@SerializedName(ApiConstants.DOMAIN_ID)
@Param(description = "the ID of the domain associated with the disk volume")
private Long domainId;
@SerializedName(ApiConstants.DOMAIN) @Param(description="the domain associated with the disk volume")
@SerializedName(ApiConstants.DOMAIN)
@Param(description = "the domain associated with the disk volume")
private String domainName;
@SerializedName("storagetype") @Param(description="shared or local storage")
@SerializedName("storagetype")
@Param(description = "shared or local storage")
private String storageType;
@SerializedName("sourceid") @Param(description="Id of the snapshot or diskOffering volume is created from")
private Long sourceId;
@SerializedName("sourcetype") @Param(description="Type of the source the volume is created from. Can be: Snapshot,DiskOffering")
private String sourceType;
@SerializedName(ApiConstants.HYPERVISOR) @Param(description="Hypervisor the volume belongs to")
@SerializedName(ApiConstants.HYPERVISOR)
@Param(description = "Hypervisor the volume belongs to")
private String hypervisor;
@SerializedName(ApiConstants.DISK_OFFERING_ID) @Param(description="ID of the disk offering")
@SerializedName(ApiConstants.DISK_OFFERING_ID)
@Param(description = "ID of the disk offering")
private Long diskOfferingId;
@SerializedName("diskofferingname") @Param(description="name of the disk offering")
@SerializedName("diskofferingname")
@Param(description = "name of the disk offering")
private String diskOfferingName;
@SerializedName("diskofferingdisplaytext") @Param(description="the display text of the disk offering")
@SerializedName("diskofferingdisplaytext")
@Param(description = "the display text of the disk offering")
private String diskOfferingDisplayText;
@SerializedName("storage") @Param(description="name of the primary storage hosting the disk volume")
@SerializedName("storage")
@Param(description = "name of the primary storage hosting the disk volume")
private String storagePoolName;
@SerializedName(ApiConstants.SNAPSHOT_ID) @Param(description="ID of the snapshot from which this volume was created")
@SerializedName(ApiConstants.SNAPSHOT_ID)
@Param(description = "ID of the snapshot from which this volume was created")
private Long snapshotId;
@SerializedName("attached") @Param(description="the date the volume was attached to a VM instance")
@SerializedName("attached")
@Param(description = "the date the volume was attached to a VM instance")
private Date attached;
@SerializedName("destroyed") @Param(description="the boolean state of whether the volume is destroyed or not")
@SerializedName("destroyed")
@Param(description = "the boolean state of whether the volume is destroyed or not")
private Boolean destroyed;
@SerializedName(ApiConstants.SERVICE_OFFERING_ID) @Param(description="ID of the service offering for root disk")
@SerializedName(ApiConstants.SERVICE_OFFERING_ID)
@Param(description = "ID of the service offering for root disk")
private Long serviceOfferingId;
@SerializedName("serviceofferingname") @Param(description="name of the service offering for root disk")
@SerializedName("serviceofferingname")
@Param(description = "name of the service offering for root disk")
private String serviceOfferingName;
@SerializedName("serviceofferingdisplaytext") @Param(description="the display text of the service offering for root disk")
@SerializedName("serviceofferingdisplaytext")
@Param(description = "the display text of the service offering for root disk")
private String serviceOfferingDisplayText;
@SerializedName("isextractable") @Param(description="true if the volume is extractable, false otherwise")
@SerializedName("isextractable")
@Param(description = "true if the volume is extractable, false otherwise")
private Boolean extractable;
@Override
public Long getObjectId() {
return getId();
return getId();
}
@Override
public Long getJobId() {
return jobId;
@ -140,7 +162,7 @@ public class VolumeResponse extends BaseResponse {
public void setJobId(Long jobId) {
this.jobId = jobId;
}
@Override
public Integer getJobStatus() {
return jobStatus;
@ -152,14 +174,14 @@ public class VolumeResponse extends BaseResponse {
}
public Boolean getDestroyed() {
return destroyed;
}
return destroyed;
}
public void setDestroyed(Boolean destroyed) {
this.destroyed = destroyed;
}
public void setDestroyed(Boolean destroyed) {
this.destroyed = destroyed;
}
public Long getId() {
public Long getId() {
return id;
}
@ -255,14 +277,6 @@ public class VolumeResponse extends BaseResponse {
this.created = created;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public String getAccountName() {
return accountName;
}
@ -295,22 +309,6 @@ public class VolumeResponse extends BaseResponse {
this.storageType = storageType;
}
public Long getSourceId() {
return sourceId;
}
public void setSourceId(Long sourceId) {
this.sourceId = sourceId;
}
public String getSourceType() {
return sourceType;
}
public void setSourceType(String sourceType) {
this.sourceType = sourceType;
}
public String getHypervisor() {
return hypervisor;
}
@ -367,43 +365,43 @@ public class VolumeResponse extends BaseResponse {
this.attached = attached;
}
public Long getServiceOfferingId() {
return serviceOfferingId;
}
public Long getServiceOfferingId() {
return serviceOfferingId;
}
public void setServiceOfferingId(Long serviceOfferingId) {
this.serviceOfferingId = serviceOfferingId;
}
public void setServiceOfferingId(Long serviceOfferingId) {
this.serviceOfferingId = serviceOfferingId;
}
public String getServiceOfferingName() {
return serviceOfferingName;
}
public String getServiceOfferingName() {
return serviceOfferingName;
}
public void setServiceOfferingName(String serviceOfferingName) {
this.serviceOfferingName = serviceOfferingName;
}
public void setServiceOfferingName(String serviceOfferingName) {
this.serviceOfferingName = serviceOfferingName;
}
public String getServiceOfferingDisplayText() {
return serviceOfferingDisplayText;
}
public String getServiceOfferingDisplayText() {
return serviceOfferingDisplayText;
}
public void setServiceOfferingDisplayText(String serviceOfferingDisplayText) {
this.serviceOfferingDisplayText = serviceOfferingDisplayText;
}
public void setServiceOfferingDisplayText(String serviceOfferingDisplayText) {
this.serviceOfferingDisplayText = serviceOfferingDisplayText;
}
public Boolean getExtractable() {
return extractable;
}
public Boolean getExtractable() {
return extractable;
}
public void setExtractable(Boolean extractable) {
this.extractable = extractable;
}
public void setExtractable(Boolean extractable) {
this.extractable = extractable;
}
public String getState() {
return state;
}
public void setState(String state) {
this.state = state;
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -1000,18 +1000,16 @@ public class Upgrade218to22 implements DbUpgrade {
}
pstmt.close();
}
// Update hypervisor type for user vm to be consistent with original 2.2.4
pstmt = conn.prepareStatement("UPDATE vm_instance SET hypervisor_type='XenServer' WHERE hypervisor_type='xenserver'");
pstmt.executeUpdate();
pstmt.close();
// Set account=systemAccount and domain=ROOT for CPVM/SSVM
pstmt = conn.prepareStatement("UPDATE vm_instance SET account_id=1, domain_id=1 WHERE type='ConsoleProxy' or type='SecondaryStorageVm'");
pstmt.executeUpdate();
pstmt.close();
}
// Update hypervisor type for user vm to be consistent with original 2.2.4
pstmt = conn.prepareStatement("UPDATE vm_instance SET hypervisor_type='XenServer' WHERE hypervisor_type='xenserver'");
pstmt.executeUpdate();
pstmt.close();
// Set account=systemAccount and domain=ROOT for CPVM/SSVM
pstmt = conn.prepareStatement("UPDATE vm_instance SET account_id=1, domain_id=1 WHERE type='ConsoleProxy' or type='SecondaryStorageVm'");
pstmt.executeUpdate();
pstmt.close();
} catch (SQLException e) {
throw new CloudRuntimeException("Can't update data center ", e);
}

View File

@ -390,8 +390,6 @@ CREATE TABLE `cloud`.`volumes` (
`updated` datetime COMMENT 'Date updated for attach/detach',
`removed` datetime COMMENT 'Date removed. not null if removed',
`state` varchar(32) COMMENT 'State machine',
`source_id` bigint unsigned COMMENT 'id for the source',
`source_type` varchar(32) COMMENT 'source from which the volume is created -- snapshot, diskoffering, template, blank',
`chain_info` text COMMENT 'save possible disk chain info in primary storage',
PRIMARY KEY (`id`),
INDEX `i_volumes__removed`(`removed`),

View File

@ -114,3 +114,6 @@ ALTER TABLE `cloud`.`user_ip_address` ADD UNIQUE (`public_ip_address`, `source_n
ALTER TABLE `cloud`.`user_ip_address` ADD CONSTRAINT `fk_user_ip_address__source_network_id` FOREIGN KEY (`source_network_id`) REFERENCES `networks`(`id`);
ALTER TABLE `cloud`.`user_ip_address` ADD CONSTRAINT `fk_user_ip_address__network_id` FOREIGN KEY (`network_id`) REFERENCES `networks`(`id`);
ALTER TABLE `cloud`.`vm_instance` ADD CONSTRAINT `fk_vm_instance__account_id` FOREIGN KEY `fk_vm_instance__account_id` (`account_id`) REFERENCES `account` (`id`);
ALTER TABLE `cloud`.`vm_instance` ADD CONSTRAINT `fk_vm_instance__service_offering_id` FOREIGN KEY `fk_vm_instance__service_offering_id` (`service_offering_id`) REFERENCES `service_offering` (`id`);

View File

@ -976,3 +976,6 @@ UPDATE vm_template SET hypervisor_type='XenServer' WHERE hypervisor_type IS NULL
UPDATE vm_template SET hypervisor_type='KVM' WHERE hypervisor_type IS NULL AND format='QCOW2';
UPDATE vm_template SET hypervisor_type='VmWare' WHERE hypervisor_type IS NULL AND format='OVA';
UPDATE vm_template SET hypervisor_type='None' WHERE hypervisor_type IS NULL AND format='ISO';
ALTER TABLE `cloud`.`volumes` ADD COLUMN `source_id` bigint unsigned COMMENT 'id for the source';
ALTER TABLE `cloud`.`volumes` ADD COLUMN `source_type` varchar(32) COMMENT 'source from which the volume is created -- snapshot, diskoffering, template, blank';

View File

@ -7,6 +7,8 @@ DELETE FROM `cloud`.`configuration` WHERE name in ('direct.attach.security.group
ALTER TABLE `cloud`.`volumes` DROP COLUMN `status`;
ALTER TABLE `cloud`.`volumes` DROP COLUMN `resource_type`;
ALTER TABLE `cloud`.`volumes` DROP COLUMN `source_id`;
ALTER TABLE `cloud`.`volumes` DROP COLUMN `source_type`;
ALTER TABLE `cloud`.`user_vm` DROP COLUMN guest_ip_address;
ALTER TABLE `cloud`.`user_vm` DROP COLUMN guest_mac_address;

View File

@ -130,6 +130,3 @@ ALTER TABLE `cloud`.`op_dc_link_local_ip_address_alloc` CHANGE COLUMN `instance_
DELETE FROM `cloud`.`sequence` WHERE name='snapshots_seq';
UPDATE `cloud`.`service_offering` s, `cloud`.`disk_offering` d SET s.ha_enabled=1 where s.id=d.id and d.system_use=1;
ALTER TABLE `cloud`.`vm_instance` ADD CONSTRAINT `fk_vm_instance__account_id` FOREIGN KEY `fk_vm_instance__account_id` (`account_id`) REFERENCES `account` (`id`);
ALTER TABLE `cloud`.`vm_instance` ADD CONSTRAINT `fk_vm_instance__service_offering_id` FOREIGN KEY `fk_vm_instance__service_offering_id` (`service_offering_id`) REFERENCES `service_offering` (`id`);