- CLOUDSTACK-3229: Attempt to adjust snapshot source path to new cache

filesystem layout
This commit is contained in:
John Burwell 2013-08-01 03:48:52 -04:00
parent 42e950aa41
commit 1162b87f14
2 changed files with 13 additions and 13 deletions

View File

@ -7430,14 +7430,14 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe
}
private boolean backupSnapshotToS3(final Connection connection,
final S3TO s3, final String srUuid, final String snapshotUuid,
final Boolean iSCSIFlag, final int wait) {
final S3TO s3, final String srUuid, final String snapshotUuid,
final Boolean iSCSIFlag, final int wait) {
final String filename = iSCSIFlag ? "VHD-" + snapshotUuid
: snapshotUuid + ".vhd";
final String dir = (iSCSIFlag ? "/dev/VG_XenStorage-"
: "/var/run/sr-mount/") + srUuid;
final String key = StringUtils.join("/", "snapshots", snapshotUuid);
final String key = String.format("/snapshots/%1$s", snapshotUuid);
try {
@ -7445,11 +7445,11 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe
S3Utils.ClientOptions.class));
// https workaround for Introspector bug that does not
// recognize Boolean accessor methods ...
parameters.addAll(Arrays.asList("operation", "put", "directory",
dir, "filename", filename, "iSCSIFlag",
iSCSIFlag.toString(), "bucket", s3.getBucketName(),
"key", key, "https", s3.isHttps() != null ? s3.isHttps().toString()
: "null"));
parameters.addAll(Arrays.asList("operation", "put", "filename",
dir + "/" + filename, "iSCSIFlag", iSCSIFlag.toString(),
"bucket", s3.getBucketName(), "key", key, "https",
s3.isHttps() != null ? s3.isHttps().toString()
: "null"));
final String result = callHostPluginAsync(connection, "s3xen",
"s3", wait,
parameters.toArray(new String[parameters.size()]));

View File

@ -1064,14 +1064,14 @@ public class XenServerStorageProcessor implements StorageProcessor {
}
private boolean backupSnapshotToS3(final Connection connection,
final S3TO s3, final String srUuid, final String snapshotUuid,
final Boolean iSCSIFlag, final int wait) {
final S3TO s3, final String srUuid, final String snapshotUuid,
final Boolean iSCSIFlag, final int wait) {
final String filename = iSCSIFlag ? "VHD-" + snapshotUuid
: snapshotUuid + ".vhd";
final String dir = (iSCSIFlag ? "/dev/VG_XenStorage-"
: "/var/run/sr-mount/") + srUuid;
final String key = StringUtils.join("/", "snapshots", snapshotUuid);
final String key = String.format("/snapshots/%1$s", snapshotUuid);
try {
@ -1079,8 +1079,8 @@ public class XenServerStorageProcessor implements StorageProcessor {
S3Utils.ClientOptions.class));
// https workaround for Introspector bug that does not
// recognize Boolean accessor methods ...
parameters.addAll(Arrays.asList("operation", "put", "directory",
dir, "filename", filename, "iSCSIFlag",
parameters.addAll(Arrays.asList("operation", "put", "filename",
dir + "/" + filename, "iSCSIFlag",
iSCSIFlag.toString(), "bucket", s3.getBucketName(),
"key", key, "https", s3.isHttps() != null ? s3.isHttps().toString()
: "null"));