Skip to content

Commit 9bfb8e5

Browse files
committed
CLOUDSTACK-2823: pass cmdline info to system vms for 30 times
(cherry picked from commit 4eedfe5)
1 parent e59dac2 commit 9bfb8e5

2 files changed

Lines changed: 15 additions & 18 deletions

File tree

‎plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java‎

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3831,24 +3831,21 @@ protected StartAnswer execute(StartCommand cmd) {
38313831

38323832
// pass cmdline info to system vms
38333833
if (vmSpec.getType() != VirtualMachine.Type.User) {
3834-
if ((conn.getVersion() < 1001000)) { // CLOUDSTACK-2823: try passCmdLine some times if kernel < 2.6.34 and qemu < 1.1.0 on hypervisor (for instance, CentOS 6.4)
3835-
//wait for 5 minutes at most
3836-
String controlIp = null;
3837-
for (NicTO nic : nics) {
3838-
if (nic.getType() == TrafficType.Control) {
3839-
controlIp = nic.getIp();
3840-
}
3841-
}
3842-
for (int count = 0; count < 30; count++) {
3843-
passCmdLine(vmName, vmSpec.getBootArgs());
3844-
//check router is up?
3845-
boolean result = _virtRouterResource.connect(controlIp, 1, 5000);
3846-
if (result) {
3847-
break;
3848-
}
3834+
//wait and try passCmdLine for 5 minutes at most for CLOUDSTACK-2823
3835+
String controlIp = null;
3836+
for (NicTO nic : nics) {
3837+
if (nic.getType() == TrafficType.Control) {
3838+
controlIp = nic.getIp();
3839+
break;
38493840
}
3850-
} else {
3841+
}
3842+
for (int count = 0; count < 30; count++) {
38513843
passCmdLine(vmName, vmSpec.getBootArgs());
3844+
//check router is up?
3845+
boolean result = _virtRouterResource.connect(controlIp, 1, 5000);
3846+
if (result) {
3847+
break;
3848+
}
38523849
}
38533850
}
38543851

‎systemvm/patches/debian/config/etc/init.d/cloud-early-config‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ get_boot_params() {
117117
if [ ! -e /dev/vport0p1 ]; then
118118
log_it "/dev/vport0p1 not loaded, perhaps guest kernel is too old." && exit 2
119119
fi
120-
while [$cmd -eq ""]; do
120+
while [ -z "$cmd" ]; do
121121
while read line; do
122122
if [[ $line == cmdline:* ]]; then
123123
cmd=${line//cmdline:/}
@@ -128,7 +128,7 @@ get_boot_params() {
128128
echo $pubkey > /root/.ssh/authorized_keys
129129
fi
130130
done < /dev/vport0p1
131-
done
131+
done
132132
chmod go-rwx /root/.ssh/authorized_keys
133133
;;
134134
vmware)

0 commit comments

Comments
 (0)