mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
CLOUDSTACK-2823: pass cmdline info to system vms for 30 times
This commit is contained in:
parent
ca5c800f8d
commit
4eedfe53fc
@ -3834,24 +3834,21 @@ public class LibvirtComputingResource extends ServerResourceBase implements Serv
|
||||
|
||||
// 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;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
}
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -117,7 +117,7 @@ get_boot_params() {
|
||||
if [ ! -e /dev/vport0p1 ]; then
|
||||
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:/}
|
||||
@ -128,7 +128,7 @@ get_boot_params() {
|
||||
echo $pubkey > /root/.ssh/authorized_keys
|
||||
fi
|
||||
done < /dev/vport0p1
|
||||
done
|
||||
done
|
||||
chmod go-rwx /root/.ssh/authorized_keys
|
||||
;;
|
||||
vmware)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user