This commit is contained in:
Pearl Dsilva 2021-12-22 14:14:36 +05:30
parent 50d0b6abe5
commit 6cf9e169ae
6 changed files with 29 additions and 10 deletions

View File

@ -1008,6 +1008,9 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
final String csr = caManager.generateKeyStoreAndCsr(vmHost, sshAccessDetails);
if (!Strings.isNullOrEmpty(csr)) {
final Map<String, String> ipAddressDetails = new HashMap<>(sshAccessDetails);
for (Map.Entry<String,String> e : ipAddressDetails.entrySet()) {
s_logger.info("PEARL - k = " + e.getKey() + " v: "+ e.getValue());
}
ipAddressDetails.remove(NetworkElementCommand.ROUTER_NAME);
final Certificate certificate = caManager.issueCertificate(csr, Arrays.asList(vm.getHostName(), vm.getInstanceName()),
new ArrayList<>(ipAddressDetails.values()), CAManager.CertValidityPeriod.value(), null);

View File

@ -90,7 +90,9 @@
<configuration>
<source>
def csVersion = pom.properties['cs.version']
println(csVersion)
def patch = pom.properties['patch.version']
println(patch)
def templateList = []
templateList.add("systemvmtemplate-${csVersion}.${patch}-kvm")
templateList.add("systemvmtemplate-${csVersion}.${patch}-vmware")
@ -123,7 +125,8 @@
<goal>wget</goal>
</goals>
<configuration>
<url>https://download.cloudstack.org/systemvm/${cs.version}/md5sum.txt</url>
<!-- <url>https://download.cloudstack.org/systemvm/${cs.version}/md5sum.txt</url>-->
<url>http://10.0.3.122/systemvmtemplate/custom/cks-debian/${cs.version}/md5sum.txt</url>
<outputDirectory>${basedir}/dist/systemvm-templates/</outputDirectory>
<skipCache>true</skipCache>
<overwrite>true</overwrite>
@ -182,7 +185,8 @@
</goals>
<configuration>
<checkSignature>true</checkSignature>
<url>https://download.cloudstack.org/systemvm/${cs.version}/systemvmtemplate-${cs.version}.${patch.version}-kvm.qcow2.bz2</url>
<!-- <url>https://download.cloudstack.org/systemvm/${cs.version}/systemvmtemplate-${cs.version}.${patch.version}-kvm.qcow2.bz2</url>-->
<url>http://10.0.3.122/systemvmtemplate/custom/cks-debian/${cs.version}/systemvmtemplate-${cs.version}.${patch.version}-kvm.qcow2.bz2</url>
<outputDirectory>${basedir}/dist/systemvm-templates/</outputDirectory>
<md5>${kvm.checksum}</md5>
</configuration>
@ -194,7 +198,8 @@
</goals>
<configuration>
<checkSignature>true</checkSignature>
<url>https://download.cloudstack.org/systemvm/${cs.version}/systemvmtemplate-${cs.version}.${patch.version}-vmware.ova</url>
<!-- <url>https://download.cloudstack.org/systemvm/${cs.version}/systemvmtemplate-${cs.version}.${patch.version}-vmware.ova</url>-->
<url>http://10.0.3.122/systemvmtemplate/custom/cks-debian/${cs.version}/systemvmtemplate-${cs.version}.${patch.version}-vmware.ova</url>
<outputDirectory>${basedir}/dist/systemvm-templates/</outputDirectory>
<md5>${vmware.checksum}</md5>
</configuration>
@ -206,7 +211,8 @@
</goals>
<configuration>
<checkSignature>true</checkSignature>
<url>https://download.cloudstack.org/systemvm/${cs.version}/systemvmtemplate-${cs.version}.${patch.version}-xen.vhd.bz2</url>
<!-- <url>https://download.cloudstack.org/systemvm/${cs.version}/systemvmtemplate-${cs.version}.${patch.version}-xen.vhd.bz2</url>-->
<url>http://10.0.3.122/systemvmtemplate/custom/cks-debian/${cs.version}/systemvmtemplate-${cs.version}.${patch.version}-xen.vhd.bz2</url>
<outputDirectory>${basedir}/dist/systemvm-templates/</outputDirectory>
<md5>${xen.checksum}</md5>
</configuration>

View File

@ -49,7 +49,7 @@
<!-- keep in alphabetic order -->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<project.systemvm.template.version>4.16.0.0</project.systemvm.template.version>
<project.systemvm.template.version>4.16.1.0</project.systemvm.template.version>
<!-- Build properties -->
<cs.jdk.version>11</cs.jdk.version>

View File

@ -1210,7 +1210,8 @@ public class ConsoleProxyManagerImpl extends ManagerBase implements ConsoleProxy
@Override
public boolean finalizeVirtualMachineProfile(VirtualMachineProfile profile, DeployDestination dest, ReservationContext context) {
// final Certificate certificate = caManager.issueCertificate(null, Arrays.asList(profile.getHostName(), profile.getInstanceName()),
// new ArrayList<>(ipAddressDetails.values()), CAManager.CertValidityPeriod.value(), null);
ConsoleProxyVO vm = consoleProxyDao.findById(profile.getId());
Map<String, String> details = userVmDetailsDao.listDetailsKeyPairs(vm.getId());
vm.setDetails(details);
@ -1280,6 +1281,15 @@ public class ConsoleProxyManagerImpl extends ManagerBase implements ConsoleProxy
buf.append(" dns2=").append(dc.getDns2());
}
// try {
// buf.append(" certificate=").append(CertUtils.x509CertificateToPem(certificate.getClientCertificate()));
// buf.append(" cacertificate=").append(CertUtils.x509CertificatesToPem(certificate.getCaCertificates()));
// if (certificate.getPrivateKey() != null) {
// buf.append(" privatekey=").append(CertUtils.privateKeyToPem(certificate.getPrivateKey()));
// }
// } catch (IOException e) {
// throw new CloudRuntimeException("Failed to transform X509 cert to PEM format", e);
// }
buf.append(" keystore_password=").append(PasswordGenerator.generateRandomPassword(16));
buf.append(" validity=").append(CAManager.CertValidityPeriod.value());
String bootArgs = buf.toString();

View File

@ -54,7 +54,7 @@ patch() {
fi
eval $(validate_checksums $md5file $oldpatchfile)
if [ "$oldmd5" == "$newmd5" ] && [ ! -f ${patchfile} ]; then
if [ "$oldmd5" == "$newmd5" ] && [ -d /usr/local/cloud/systemvm ] && [ "$(ls -A /usr/local/cloud/systemvm)" ]; then
log_it "Checksum matches, do need to patch"
return 0
fi

View File

@ -348,9 +348,9 @@ function main() {
packer_build
# process the disk at dist
kvm_export
ovm_export
xen_server_export
# kvm_export
# ovm_export
# xen_server_export
vmware_export
# hyperv_export
rm -f "dist/${appliance}"