mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-02 11:52:28 +01:00
fixed script
This commit is contained in:
parent
08a1809a49
commit
20fd2723e9
@ -4,31 +4,23 @@
|
||||
#set -x
|
||||
|
||||
# propagate VLANs to other host
|
||||
|
||||
for vlan_networkname in $(xe network-list | grep "name-label ( RW): VLAN" | awk '{print $NF}');
|
||||
do
|
||||
vlan_network=$(xe network-list name-label=$vlan_networkname --minimal)
|
||||
this_tagged_pif=$(xe pif-list network-uuid=$vlan_network --minimal | cut -d, -f 1)
|
||||
if [ -x $this_tagged_pif ]; then
|
||||
continue
|
||||
fi
|
||||
vlan=$(xe pif-param-get uuid=$this_tagged_pif param-name=VLAN)
|
||||
this_host=$(xe pif-param-get uuid=$this_tagged_pif param-name=host-uuid)
|
||||
this_device=$(xe pif-param-get uuid=$this_tagged_pif param-name=device)
|
||||
untagged_pif=$(xe pif-list host-uuid=$this_host device=$this_device VLAN=-1 --minimal)
|
||||
untagged_network=$(xe pif-param-get uuid=$untagged_pif param-name=network-uuid)
|
||||
for networkname in $(xe network-list | grep "name-label ( RW): VLAN" | awk '{print $NF}');
|
||||
do
|
||||
network=$(xe network-list name-label=$networkname --minimal)
|
||||
tagpif=$(xe pif-list network-uuid=$network --minimal | cut -d, -f 1)
|
||||
device=$(xe pif-param-get uuid=$tagpif param-name=device)
|
||||
vlan=$(xe pif-param-get uuid=$tagpif param-name=VLAN)
|
||||
for host in $(xe host-list | grep ^uuid | awk '{print $NF}')
|
||||
do
|
||||
tagpif=$(xe pif-list network-uuid=$vlan_network host-uuid=$host --minimal)
|
||||
tagpif=$(xe pif-list network-uuid=$network host-uuid=$host --minimal)
|
||||
if [ -z $tagpif ]; then
|
||||
pif=$(xe pif-list host-uuid=$host network_uuid=$untagged_network --minimal)
|
||||
xe vlan-create network-uuid=$vlan_network pif-uuid=$pif vlan=$vlan
|
||||
pif=$(xe pif-list host-uuid=$host device=$device --minimal)
|
||||
xe vlan-create network-uuid=$network pif-uuid=$pif vlan=$vlan
|
||||
fi
|
||||
done
|
||||
done
|
||||
|
||||
|
||||
|
||||
# fake PV for PV VM
|
||||
|
||||
fake_pv_driver() {
|
||||
@ -42,8 +34,7 @@ fake_pv_driver() {
|
||||
echo "Warning VM $vm is HVM, but PV driver is not installed, you may need to stop it manually"
|
||||
return 0
|
||||
fi
|
||||
host=$(xe vm-param-get uuid=$vm param-name=resident-on)
|
||||
xe host-call-plugin host-uuid=$host plugin=vmops fn=preparemigration args:uuid=$vm
|
||||
make_migratable.sh $vm
|
||||
}
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user