<div dir="ltr"> Hi Folks,<br><br>I am using Mitaka OpenStack and VLAN as network type driver for tenant VMs. Initially i have provisioned all the VMs (Including Customer VMs) inside the admin. I want to segregate my internal VMs and Customer VMs, for this to accomplish i have created different tenant names and now i want customer VMs from admin tenant to Customer tenant, <br><br>On Google , i have a found a script which migrates the VMs but that script doesn't update network and security group details,<br><br>Can anyone help me and suggest what steps needs to executed to update network , security group and attached Volumes ..?<br><br>Below is the exact script:<br><br>    #!/bin/bash<br>    for i<br>    do<br>    if [ "$i" != "$1" ]; then<br>    echo "moving instance id " $i " to project id" $1;<br>    mysql -uroot -s -N <<query<br>    use nova;<br>    update instances set project_id="$1" where uuid="$i";<br>    query<br>    else<br>    #get project id of the instance before update<br>    old_proj_id=$(mysql -uroot -s -N <<query<br>    use nova;<br>    select project_id from instances where uuid="$2";<br>    query<br>    )<br>    #get user id of the instance before update<br>    user_id=$(mysql -uroot -s -N <<query<br>    use nova;<br>    select user_id from instances where uuid="$2";<br>    query<br>    )<br>    <br>    fi<br>    done<br>    echo "quota_resync " $old_proj_id;<br>    ./quota_resync.sh $old_proj_id $user_id;<br>    echo "quota_resync " $1;<br>    ./quota_resync.sh $1 $user_id;<br>    root@xxxx:/mnt# cat quota_resync.sh<br>    #!/bin/bash<br>    count=$(mysql -uroot -s -N <<query<br>    use nova;<br>    select count(*) from instances where project_id="$1" and vm_state="active";<br>    query<br>    )<br>    <br>    memory=$(mysql -uroot -s -N <<query<br>    use nova;<br>    select sum(memory_mb) from instances where project_id="$1" and vm_state="active";<br>    query<br>    )<br>    <br>    vcpu=$(mysql -uroot -s -N <<query<br>    use nova;<br>    select sum(vcpus) from instances where project_id="$1" and vm_state="active";<br>    query<br>    )<br>    <br>    echo "count" $count;<br>    echo "vcpus" $vcpu;<br>    echo "Ram" $memory;<br>    <br>    update=$(mysql -uroot -s -N <<query<br>    use nova;<br>    update quota_usages set in_use=$count where project_id="$1" and user_id="$2" and resource="instances";<br>    update quota_usages set in_use=$memory where project_id="$1" and user_id="$2" and resource="ram";<br>    update quota_usages set in_use=$vcpu where project_id="$1" and user_id="$2" and resource="cores";<br>    query<br>    )<br>    root@xxxx:/mnt#<br><br>Script Execution Method : # /vm_move.sh "destination_tenant_id" "VM_id"<br><br>  <br><br clear="all"><br>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature">Best Regards<br>Pradeep Kumar</div></div>