I am trying to create a new snapshot view on my machine and i am using the following procedure:
creating the view using
ct mkview -snapshot -tag testview -vws /home/store/testview.vws /home/view/testview
here the view gets created but fails to register
which i register using the ct update on this /home/view/testview location
tried to change the configspec using
ct edcs &
but got error "cleartool: Error: Cannot get view info for current view: not a ClearCase object."
explicitly modifying the config_spec using vi editor, and the updating the view ends up creating a log...but no files are copied :(
Can someone please direct me as to where i am going wrong?
What is your error message on the snapshot view creation?
Something like:
cleartool: Warning: Unable to register new snapshot view: not a ClearCase object
snapshot view may not be recognized by some commands.
Created snapshot view directory "yourServer".
Server view_server (pid=2842) on "/home/store/testview.vws" died on startup; marking it as "down".
?
Any "Unable to register new snapshot view" message will mean that you are ot able to edit your config spec (so ct edcs will fail)
Try to specificy all the argument for your storage path:
ct mkview -snapshot -tag testview \
-vws /home/store/testview.vws \
-host yourServerName \
-hpath /home/store/testview.vws \
-gpath /home/store/testview.vws \
/home/view/testview
(is your view server on the same server than your view?)
Related
Why is my working directory view empty?
How to set the working directory view
Working directory view: ** NONE **
How to set it?
[shibanis#linuxserver206 C-T3-P-fad-viewstore7]$ ct pwv
Working directory view: ** NONE **
Set view: hdbu_iop_shibanis_vu
And:
View details:[shibanis#linuxserver206 C-T3-P-fad-viewstore7]$ ct lsview -long hdbu_iop_shibanis_vu
Tag: hdbu_iop_shibanis_vu "san to nas storage"
Global path: /net/in0oianas002/in0oianas002_SAS_U1/C-T3-P-fad-viewstore7/hdbu_iop_shibanis_vu.vws
Server host: andd011
Region: AND_DSLAM
Active: YES
View tag uuid:8e18a9d4.b2c511e5.8058.78:ac:c0:bb:69:2c
View on host: andd011
View server access path: /net/in0oianas002/in0oianas002_SAS_U1/C-T3-P-fad-viewstore7/hdbu_iop_shibanis_vu.vws
View uuid: 8e18a9d4.b2c511e5.8058.78:ac:c0:bb:69:2c
View owner: adcc/shibanis
Command used to create view:(sample)
/usr/atria/bin/cleartool mkview -tag iop5_shibanis -host andd011 -hpath /net/in0oianas002/in0oianas002_SAS_U1/C-T3-P-fad-viewstore7/iop5_shibanis.vws -gpath
Once a dynamic view has been set with cleartool setview (and it is set, since your pwn shows your view has set), it uses a view context '/'.
That means your path within that view becomes: /vobs/aVob/path/to/a/file.
But that also means you need to make sure:
a vob is mounted: cleartool mount /vobs/avob
your config spec does select that vob: look at cleartool catcs output to check the selection rules.
How can I select an element with a specific baseline in a UCM ClearCase snapshot view config spec from a script?
I'm writing a script which will create a snapshot view of a given stream and should select a specific baseline version of the stream contents. I would prefer to set the element baseline in the same manner I'm setting the load rules but can't find a way to do that.
Here's what I'm doing so far:
...
cleartool mkview -snapshot -tag ${cc_view} -ptime -stream ${cc_stream}#\\myVob -vws ${cc_dir}/${cc_view}.vws ${cc_dir}/${cc_view} || die "Failed to create view. Exiting."
cd ${cc_dir}/${cc_view}
# Set the element baselines
cleartool edcs -overwrite
cleartool update -overwrite -add_loadrules ${components} || die "Failed to update view. Exiting."
...
Another issue might be that I can't set the element version in the config spec in the custom block - I have to do it in the component selection rules instead! Overwriting UCM's "Component selection rules" section feels a bit dangerous. I do this in the edcs phase:
ucm
identity UCM.Stream <...id...>
# ONLY EDIT THIS CONFIG SPEC IN THE INDICATED "CUSTOM" AREAS
# This config spec was automatically generated by the UCM stream
# "myStream" at 2017-06-01T07:43:33+02:00.
# Select checked out versions
element * CHECKEDOUT
# Component selection rules...
element "[ee5a<...id...>=\MYCOMPONENT]/..." my-component-1.0 -nocheckout
end ucm
#UCMCustomElemBegin - DO NOT REMOVE - ADD CUSTOM ELEMENT RULES AFTER THIS LINE
#UCMCustomElemEnd - DO NOT REMOVE - END CUSTOM ELEMENT RULES
# Non-included component backstop rule: no checkouts
element * /main/0 -ucm -nocheckout
#UCMCustomLoadBegin - DO NOT REMOVE - ADD CUSTOM LOAD RULES AFTER THIS LINE
load \MYCOMPONENT
Related questions:
UCM: How to create dynamic view (base clearcase) on arbitrary incremental baseline
Snapshot from old baseline
As VonC suggested I moved to base CC:
...
cleartool mkview -snapshot -tag ${cc_view} -ptime -vws ${cc_dir}/${cc_view}.vws ${cc_dir}/${cc_view} || die "Failed to create view. Exiting."
cd ${cc_dir}/${cc_view}
cat << EOF > config_spec
element * CHECKEDOUT
element * ${baseline} -nocheckout
element * /main/LATEST
EOF
cleartool setcs -force -overwrite config_spec || die "Failed to set config spec. Exiting."
cleartool update -overwrite -add_loadrules ${components} || die "Failed to update view. Exiting."
...
First, that will only work if the baseline is full.
If it is an incremental one, you have the risk of selecting an element with a label (associated to the baseline) which is not set on the parent folder, making that element inaccessible.
Second, that kind of custom selection is best done with a non-UCM base ClearCase snapshot view into which you have:
the same load rules as your UCM snapshot view
but a simpler set of selection rules:
element * yourBaselineId
element * /main/LATEST
$ cleartool rmstream stream:tiger#/vobs/forest
Remove stream
"stream:tiger#/vobs/forest"? [no] yes
cleartool: Error: No tag in region for view "d6ca911d.229a41bb.942b.fd:ed:f2:bb:5c:f8".
cleartool: Error: Unable to remove stream "stream:tiger#/vobs/forest".
how to find out which site has clearcase view uuid d6ca911d.229a41bb.942b.fd:ed:f2:bb:5c:f8?
The IBM technote swg21127922 does list a MultiSite environment and the view existing at a different replica site as a possible cause for this error message.
It might not be mandatory to switch to the site referencing that view to move forward though.
The steps described to resolve the issue involve removing the view by its uuid in the pvob of the stream.
I used that technique (rmview --uuid) before in "Removal of clearcase views involves any housekeeping?".
For instance:
cleartool lsstream -l stream_name#\pvob.
The output will include:
views:
98573bec.d7e34570.a71c.e8:ab:7c:50:d4:02
Then:
ct desc -l vob:\ford_pvob
The output include:
VOB holds objects from the following views:
f15eagle:d:\ClearCase_Storage\views\RATIONAL\evchan\evchan_proj1_2.vws [uuid 98573bec.d7e34570.a71c.e8:ab:7c:50:d4:02]
You will need change directory (cd) into the PVOB
Example:
W:\>cd ford_pvob
W:\ford_pvob>
Remove the view reference from the PVOB using, cleartool rmview -uuid uuid_number
Note: By adding the -all switch, you will ensure to remove the view reference from the PVOB and any UCM Component VOBs that may also have a reference from this view; cleartool rmview -all -uuid uuid_number.
In this particular example, the -all was not required since we are only removing the view reference from the PVOB.
Example:
W:\ford_pvob>ct rmview -uuid 98573bec.d7e34570.a71c.e8:ab:7c:50:d4:02
Removed references to view "f15eagle:d:\ClearCase_Storage\views\RATIONAL\evchan\evchan_proj1_2.vws" from VOB "\ford_pvob".
Now the stream can be removed, using cleartool rmstream stream_name#\pvob
Example:
W:\ford_pvob>ct rmstream evchan_proj1_2#\ford_pvob
Remove stream "evchan_proj1_2#\ford_pvob"? [no] y
Removed stream "evchan_proj1_2#\ford_pvob" .
I'm trying to write a script to get the vob with the help of cleartool.
I have the activity id, the stream name and the stream location as input. From this I need to get the vob.
cleartool lsvob -short is pretty much what I need, but I only need the vob of the activity and stream.
cleartool describe -cview view-location did also not help.
Does anyone have an idea how to achieve this?
EDIT:
cleartool descr -cact leads to the following:
activity "ActivityID"
created 2014-12-15T13:53:49+01:00 by User
master replica: HES#\vob
owner: dom\owner
group: group
stream: stream#\vob
current view: view name
title: Title
change set versions:
...changes
Attributes:
activity_ok = "yes"
Delivered = "no"
Finished = "no"
Type_Activity = "User"
If you execute a cleartool describe from within the view, it should pick up on the "vob of the activity" (meaning the PVob which is an admin vob of the current UCM root-based component vob that the view is accessing)
cd /path/to/my/view/vobs/MyVob
cleartool descr -cact
cleartool descr -fmt "%Xn" -cact
That should return the name of the currently set activity followed by #/vobs/ThePVob.
ThePVob is the tag you are looking for: it will be the same for all activities in that stream.
Using fmt_ccase, you can limit the output to the fully qualified name of the current activity: activty#\.
I have config spects for a view and I need to create a view in Clear Case using command prompt.
Please let me about the commands I can use with some example.
Thanks in Advance!
That would be using:
cleartool mkview
followed by cleartool setcs -tag yourDynView pname, with pname being "a text file whose contents are to become the view's new config spec".
For creating a dynamic view:
cleartool mkview -tag yourDynView \\shared\path\to\viewStorage\yourDynView.vws
That will create a dynamic view with a default config spec:
element * CHECKEDOUT
element * /main/LATEST
You will then be able to replace that config spec with any other config spec stored in a file, with the setcs command.