CLOUDSTACK-2823: pass cmdline info to system vms for 30 times

(cherry picked from commit 4eedfe53fc)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>

Conflicts:
	plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
	systemvm/patches/debian/config/etc/init.d/cloud-early-config
This commit is contained in:
Wei Zhou 2014-12-08 15:45:29 +01:00 committed by Rohit Yadav
parent 314e2dacee
commit 1e09494a4e
2 changed files with 14 additions and 17 deletions

View File

@ -3692,24 +3692,21 @@ ServerResource {
// pass cmdline info to system vms
if (vmSpec.getType() != VirtualMachine.Type.User) {
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)
//wait for 5 minutes at most
String controlIp = null;
for (NicTO nic : nics) {
if (nic.getType() == TrafficType.Control) {
controlIp = nic.getIp();
}
//wait and try passCmdLine for 5 minutes at most for CLOUDSTACK-2823
String controlIp = null;
for (NicTO nic : nics) {
if (nic.getType() == TrafficType.Control) {
controlIp = nic.getIp();
break;
}
for (int count = 0; count < 30; count ++) {
passCmdLine(vmName, vmSpec.getBootArgs());
//check router is up?
boolean result = _virtRouterResource.connect(controlIp, 1, 5000);
if (result) {
break;
}
}
for (int count = 0; count < 30; count++) {
passCmdLine(vmName, vmSpec.getBootArgs());
//check router is up?
boolean result = _virtRouterResource.connect(controlIp, 1, 5000);
if (result) {
break;
}
} else {
passCmdLine(vmName, vmSpec.getBootArgs() );
}
}

View File

@ -118,7 +118,7 @@ get_boot_params() {
log_it "/dev/vport0p1 not loaded, perhaps guest kernel is too old." && exit 2
fi
while [$cmd -eq ""]; do
while [ -z "$cmd" ]; do
while read line; do
if [[ $line == cmdline:* ]]; then
cmd=${line//cmdline:/}