On Filer:
Creates an access control role name vol_snapshot which only has access to the volume snapshot commands.
security login role create –role vol_snapshot –cmddirname “volume” –access all –query “”
Create a user that has access only to the volume snapshot commands.
security login create –username sadmin –application ssh –authmethod publickey –role vol_snapshot
On Host:
Generate an ssh key
ssh-keygen –t rsa
A public key file of form “id_rsa.pub” is placed in ~/.ssh directory.
Cut and paste the public key generated in file and place as value on the filer.
cd .ssh
cat id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAsT18WDJho+recfdN77Qm7msj+LSgOZ7exSGMtM5N1//T5KJT1k4qXqY38j14Kn1pYAzeMaVGPd4uzC+q4wO8bKEZyoyfsLba4lzypNSf8sU4+MZ2xSiRd2KqRPb2up5Si64aJFnu+9Q98GhO2J5K/OzOQBoyCZW/ntZlZ0KNCz2o+L7osa2aEpgbupIz54qkO7Q2+es5RLg3FN+S6lmffq4whwu7WhVm6oAI6Rks7670ot1ydTOemdobICBtLXlJLwGicSaacWWh7C4v99GPDvx/r6atoY+BpEOQ7bM0s9eALcJ6njgGxpL71+iBBKb3beas5Za7ULgOJRxILjHJtQ== root@ibmx3755-svl03
On Filer, Add the Key Information:
security login publickey create -username sadmin -index 2 -publickey "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAsT18WDJho+recfdN77Qm7msj+LSgOZ7exSGMtM5N1//T5KJT1k4qXqY38j14Kn1pYAzeMaVGPd4uzC+q4wO8bKEZyoyfsLba4lzypNSf8sU4+MZ2xSiRd2KqRPb2up5Si64aJFnu+9Q98GhO2J5K/OzOQBoyCZW/ntZlZ0KNCz2o+L7osa2aEpgbupIz54qkO7Q2+es5RLg3FN+S6lmffq4whwu7WhVm6oAI6Rks7670ot1ydTOemdobICBtLXlJLwGicSaacWWh7C4v99GPDvx/r6atoY+BpEOQ7bM0s9eALcJ6njgGxpL71+iBBKb3beas5Za7ULgOJRxILjHJtQ== root@ibmx3755-svl03"
ASSUMPTIONS
An aggregate, vserver and network interface has been created.
The p4 server is running in order to do a p4 submit ** p4d -p 172.31.10.101:1666 -r /mnt/p4db -J
pwd/journal -q -L
pwd/logs -v server=3 -v track=1 -d
.
On filer, Create and mount volume on filer:
vol create -volume ws_template -vserver perforce -aggregate p4 -size 30G -state online -type RW -policy default -unix-permissions ---rwxrwxrwx -junction-path /ws_template
On host as root, Mount the volume using the network interface LIF:
mount –t nfs –o vers=3,local_lock=all,nocto 172.31.10.9:/ /mnt
Extract the source in which template will be created.
cd /mnt/ws_template
tar xvf /mnt/releases/linux-4.0.4.tar.xz
Define your p4 client config: export P4PORT=172.31.10.101:1666 export P4CLIENT=testaj p4 set p4 client
Add the source files to depots and submit find . –type f –print | p4 –x –add p4 submit
Build
make
The above assume that the source files has not been checked in, however, if they are checked in then just do a "p4 sync", define "p4 client" and then make.
On Host as root, take snapshot and create FlexClone and then modify permissions and mount to correct junction path. NOTE: the ssh commands below can be combined to one line and the unix permissions do not need to be modified since those can be overridden at the host (?):
ssh sadmin@172.17.39.164 "vol clone create -vserver perforce -flexclone t1 -parent-volume ws_template -junction-active true"
ssh sadmin@172.17.39.164 "vol modify -vserver perforce -volume t1 -unix-permissions ---rwxrwxrwx" ssh sadmin@172.17.39.164 "vol mount -vserver perforce -volume t1 -junction-path /ws1"
ls /mnt/ws1
cd /mnt/ws1
chown -R tester:tester linux-4.0.4
ANOTHER OPTION: One can also have the option to create a snapshot first of volume and then create a FlexClone based on that snapshot.
As user tester:
cd /mnt/ws1
Define your p4 client config:
export P4PORT=172.31.10.101:1666
export P4CLIENT=testeraj
p4 set
p4 client
Run "p4 flush" to make workspace think it has the file content already.
p4 flush
User can now edit workspace.
As user, delete client workspace
p4 client –d testeraj
As root, delete flexclone volume workspace
ssh sadmin@172.17.39.164 " vol unmount -vserver perforce -volume t1"
ssh sadmin@172.17.39.164 " vol offline -vserver perforce –volume t1"
ssh sadmin@172.17.39.164 " vol delete -vserver perforce -volume t1"
# FLEXCLONE SETUP # ## ## ##Setup for SSH Passwordless On Filer: 1. Creates an access control role name vol_snapshot which only has access to the volume snapshot commands. `security login role create –role vol_snapshot –cmddirname “volume” –access all –query “”` 2. Create a user that has access only to the volume snapshot commands. `security login create –username sadmin –application ssh –authmethod publickey –role vol_snapshot` On Host: 3. Generate an ssh key `ssh-keygen –t rsa` A public key file of form “id_rsa.pub” is placed in ~/.ssh directory. 4. Cut and paste the public key generated in file and place as value on the filer. `cd .ssh` `cat id_rsa.pub` ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAsT18WDJho+recfdN77Qm7msj+LSgOZ7exSGMtM5N1//T5KJT1k4qXqY38j14Kn1pYAzeMaVGPd4uzC+q4wO8bKEZyoyfsLba4lzypNSf8sU4+MZ2xSiRd2KqRPb2up5Si64aJFnu+9Q98GhO2J5K/OzOQBoyCZW/ntZlZ0KNCz2o+L7osa2aEpgbupIz54qkO7Q2+es5RLg3FN+S6lmffq4whwu7WhVm6oAI6Rks7670ot1ydTOemdobICBtLXlJLwGicSaacWWh7C4v99GPDvx/r6atoY+BpEOQ7bM0s9eALcJ6njgGxpL71+iBBKb3beas5Za7ULgOJRxILjHJtQ== root@ibmx3755-svl03 5. On Filer, Add the Key Information: `security login publickey create -username sadmin -index 2 -publickey "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAsT18WDJho+recfdN77Qm7msj+LSgOZ7exSGMtM5N1//T5KJT1k4qXqY38j14Kn1pYAzeMaVGPd4uzC+q4wO8bKEZyoyfsLba4lzypNSf8sU4+MZ2xSiRd2KqRPb2up5Si64aJFnu+9Q98GhO2J5K/OzOQBoyCZW/ntZlZ0KNCz2o+L7osa2aEpgbupIz54qkO7Q2+es5RLg3FN+S6lmffq4whwu7WhVm6oAI6Rks7670ot1ydTOemdobICBtLXlJLwGicSaacWWh7C4v99GPDvx/r6atoY+BpEOQ7bM0s9eALcJ6njgGxpL71+iBBKb3beas5Za7ULgOJRxILjHJtQ== root@ibmx3755-svl03"` ##Create Base Template ASSUMPTIONS * An aggregate, vserver and network interface has been created. * The p4 server is running in order to do a p4 submit ** `p4d -p 172.31.10.101:1666 -r /mnt/p4db -J `pwd`/journal -q -L `pwd`/logs -v server=3 -v track=1 -d` . 1. On filer, Create and mount volume on filer: `vol create -volume ws_template -vserver perforce -aggregate p4 -size 30G -state online -type RW -policy default -unix-permissions ---rwxrwxrwx -junction-path /ws_template ` 2. On host as root, Mount the volume using the network interface LIF: `mount –t nfs –o vers=3,local_lock=all,nocto 172.31.10.9:/ /mnt` 3. Extract the source in which template will be created. cd /mnt/ws_template tar xvf /mnt/releases/linux-4.0.4.tar.xz 4. Define your p4 client config: export P4PORT=172.31.10.101:1666 export P4CLIENT=testaj p4 set p4 client 5. Add the source files to depots and submit find . –type f –print | p4 –x –add p4 submit 6. Build make The above assume that the source files has not been checked in, however, if they are checked in then just do a "p4 sync", define "p4 client" and then make. ##Create FlexClone Workspace For User 1. On Host as root, take snapshot and create FlexClone and then modify permissions and mount to correct junction path. NOTE: the ssh commands below can be combined to one line and the unix permissions do not need to be modified since those can be overridden at the host (?): `ssh sadmin@172.17.39.164 "vol clone create -vserver perforce -flexclone t1 -parent-volume ws_template -junction-active true"` `ssh sadmin@172.17.39.164 "vol modify -vserver perforce -volume t1 -unix-permissions ---rwxrwxrwx" ssh sadmin@172.17.39.164 "vol mount -vserver perforce -volume t1 -junction-path /ws1"` `ls /mnt/ws1` `cd /mnt/ws1` `chown -R tester:tester linux-4.0.4` ANOTHER OPTION: One can also have the option to create a snapshot first of volume and then create a FlexClone based on that snapshot. 2. As user tester: `cd /mnt/ws1` 3. Define your p4 client config: `export P4PORT=172.31.10.101:1666` `export P4CLIENT=testeraj` `p4 set` `p4 client` 4. Run "p4 flush" to make workspace think it has the file content already. `p4 flush` User can now edit workspace. ##Delete FlexClone Workspace 1. As user, delete client workspace `p4 client –d testeraj` 2. As root, delete flexclone volume workspace `ssh sadmin@172.17.39.164 " vol unmount -vserver perforce -volume t1"` `ssh sadmin@172.17.39.164 " vol offline -vserver perforce –volume t1"` `ssh sadmin@172.17.39.164 " vol delete -vserver perforce -volume t1"`
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#4 | 18997 | netapp |
Rename/move file(s) Project name change: moving //guest/netapp/p4flexclone/main/… to //guest/netapp/p4flex/main/… |
||
#3 | 13706 | agnesj | Updated the FlexClone instructions with doing snapshots first and then cloning. | ||
#2 | 13618 | agnesj | Corrected some formatting. | ||
#1 | 13617 | agnesj | FlexClone Setup Description |